REGEX patters, boundary v anchor
Hi, I have been trying to test for a piece of text followed by 0 to 2 characters, but no more;
so this;
=REGEXTEST(“a,bc”,”a.{0,2}$”,1) = false as expected ; literal “a” followed by 0 to 2 but no more characters
but trying to search within a string, so anchor $ cannot be used , so a word boundary \b ,
=REGEXTEST("c d e f a,bc z","a.{0,2}\b",1) = true ? but it's the same 'a,bc"
bu t =REGEXTEST(“c d e f abcd z”,”a.{0,2}\b”,1) = false “abcd” is not “a” followed by 2 other charcters correct
I know this can get quite complex especially with look aheads etc but can someone explain what is happening or
link to good site on patterns ?
Richard
Read more here: Source link
