Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I try to match using regular expression using:
admin\/remaining-pairs\/\d*\/\d*\/\d*\/\d*done
I get this error:
preg_match(): Unknown modifier 'r' in rules_data_text_comparison() (line 423...
/admin\/remaining-pairs\/\d*\/\d*\/\d*\/\d*done/
I have tried with and with "/" as delimiters at the beginning and end and also with "/g" at the end.
The regex expression seems to work on validating sites I have used, including http://gskinner.com/RegExr/ which is linked to from the rules page.
What changes do I need to make for this to work in rules?
Thanks.
Comments
Comment #2
jsibley CreditAttribution: jsibley commentedSo, this doesn't give an error and should be equivalent to the above, if I understand correctly:
/admin/remaining-pairs/[0-9]*/[0-9]*/[0-9]*/done/
However, it doesn't match the path below:
mysite/admin/remaining-pairs/5/6/24/done
Any ideas?
Comment #3
margyly CreditAttribution: margyly commentedI can't get this to work in a Rules condition either.
Comment #4
TR CreditAttribution: TR commentedSimplify your Rule, export it, post it here, and we'll try to make it work for you.
Comment #5
TR CreditAttribution: TR commentedIf you continue to have a problem with regular expressions, please provide the information in #4.