I’m trying to find the regex in java that matches a substring with TTFI within a string TTFI
I’m using /TTFI/ to match the string TTFI in a string such as TTFI1233
When using the folllowing URL http://www.regexplanet.com/advanced/java/index.html to check, it results matches() No
The fiddle URL is :http://fiddle.re/e3y2
Thanks,
Nav
The slashes are not part of the regular expression, rather language-specific delimiters used in perl, javascript, etc. Also note that a Java RE requires the entire string to match – using
.*TTFI.*matches your input perfectly.