Find Characters with Lazy Matching -- typo found in challenge?

In the challenge: Find Characters with Lazy Matching there seems to be a mistake or typo in the challenge.

Am I mistaken? If you compare the results shown at each of the links below you can see what I mean.

t[a-z]*?i matches “titani” in “titanic” (not “ti”)… see Rubular: t[a-z]*?i
t[a-z]*i matches “titani” in “titanic” (as stated in the challenge)… see Rubular: t[a-z]*i
t[a-z]?i matches “ti” (not t[a-z]*?i)… see Rubular: t[a-z]?i

I am not sure that Ruby uses the same regex implementation as JavaScript, if you use something like regex101 you can select ECMAScript, and that is the javascript implementation

but the first case finds two parts of the word that satisfy, “ti” and “tani”

1 Like

Well I hadn’t realized that.

regex101: build, test, and debug regex does not equal Rubular: t[a-z]*?i

Thanks for pointing that out

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.