RegEx word boundaries
Recently I was looking for the word "fail" or "pass" in a string so I had the following regEx set up:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
#reFindNoCase("pass|fail", status)#
1#reFindNoCase("pass|fail", status)#
Which worked fine until testing came along and "failed" got passed through successfully.
To prevent this you need to use regex boundaries, "\b", so my new statement becomes:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
#reFindNoCase("\bpass\b|\bfail\b", status)#
1#reFindNoCase("\bpass\b|\bfail\b", status)#
In simple terms "\b" perform a "whole word only" search means that it trapped 'failed', 'failure' you get the point.