Login  Register

'matches' function in macros

Posted by Mat Hickman on Jan 12, 2009; 4:53pm
URL: http://imagej.273.s1.nabble.com/matches-function-in-macros-tp3694076.html

Hi,

It's possible that I'm being useless when it comes to regular expressions,
but I'm really struggling to get the matches function to work. I test my
regex on websites and it suggests that they work fine, but 'matches'
stubbornly keeps returning zero. I've resorted to a brute-force approach,
just trying lots and lots of different regex's, but all to no avail. Is
there any chance someone could post a few examples?

Thus far I've tried:
matches("Hello", "e*")
matches("Hello", "e")
matches("Hello", "/e/")
matches("Hello", "(e)")
matches("Hello", "m/e/")
matches("Hello", "/[e]/")
etc etc.

All combinations therein as well.

Any help would be greatly appreciated.

Best wishes,

Mat