RegEx in condition builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2012 02:16 AM
Hello,
In the condition builder we now have the 'matches regex' operator. ...But what are all the regex we CAN use in it?
For example: beginning of line operator '^' does not play nicely with the condition builder in this case as it is assumed it means AND and will add a second condition when saving.
Is there some other character denoting beginning of line for the condition builder? What other exeptions might there be and do they have workarounds?
thanks in advance,
Jaakko Jalo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2014 02:38 PM
Not tried this, but based on the scripts I have, try adding a forward slash at the beginning and end of your condition
an example from a script
var regex = /\d{1,2}(st|rd|th)\s{1}(Jan|Feb|Mar|Apr|May|Jun|Jul|Apr|Sep|Oct|Nov|Dec)\s{1}\d{4}\s{1}(at)\s{1}\d{1,2}:\d{1,2}(hrs)/;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2014 07:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2014 08:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2014 02:47 PM
I did some experimentation with the "match regex" condition within Eureka, and found a couple useful pieces of info:
- The beginning of line is implicit at the beginning of the textbox regex, so you can omit the '^' if you're trying to match from beginning of line. For multiline matching, you need to explicitly match the end of line characters to avoid doing single line matching -- I'm not sure how those vary across platforms, but something like (\r|\n|\r\n) should take care of it.
- It's based off of javascript regexes, but the contents of the field correspond to the javascript regex as it is within the enclosing forward slashes '/'. E.g.: if the box contains "some text" (minus quotes), the equivalent javascript regex would be similar to /^some text/. This means that it may not be possible to use the flags that would appear after the trailing slash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2014 03:50 PM
Try this here: JavaScript Lab - Tools - JS Regex Generator
