This post relates to my post here http://groups.drupal.org/node/94214

Basically, I wish to know whether regular expressions and tokens can be placed directly into a rules field when doing a textual comparison. That is, can I drop a token into field 1: [node:sell price] and a regular expression into field 2: (0-3)(0-9)? The idea here would be to trigger the rule when the sell price is between 0 and 39.

Comments

mitchell’s picture

Component: Rules Core » Rules Engine
Status: Active » Fixed

Yes, absolutely. Textual comparison includes an optional checkbox near the second comparison field to use regex instead of plain text. There's also a tool in the help note for checking/constructing your regex pattern, and the rules debug feature is also helpful for checking that each part runs smoothly.

Please reopen if that info doesn't help get you through the configuration.

melchoir55’s picture

This is funny. I went back thinking "how could I miss that" and found no such box. Then I realized I had selected "numeric comparison" rather than "textual comparison". duh.

Thanks for the help.

melchoir55’s picture

accidental double post

I'll use this to point out that the regex build helper is insanely helpful.

mitchell’s picture

Glad to hear, melchoir55!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.