- if ((s = validate_regexp(regex)) != NULL) {
- printf("\"%s\" is not a valid regular expression: ", regex);
+ uq_orig_regex = unquote_string(regex);
+ uqregex = stralloc(uq_orig_regex);
+
+ /* Add a terminating '/' if it is not there, maybe before a '$' */
+ len_uqregex = strlen(uqregex);
+ if (uqregex[len_uqregex-1] == '$') {
+ if (uqregex[len_uqregex-2] != '/') {
+ uqregex[len_uqregex-1] = '\0';
+ strappend(uqregex, "/$");
+ }
+ } else if (uqregex[len_uqregex-1] != '/') {
+ //uqregex[len_uqregex-1] = '\0';
+ strappend(uqregex, "/");
+ }
+ if ((s = validate_regexp(uqregex)) != NULL) {
+ g_printf(_("\"%s\" is not a valid regular expression: "), uq_orig_regex);
+ amfree(uqregex);
+ amfree(uq_orig_regex);