0

Given the statement

/(?<=.*)./.match("abc")

I get an error that there is an invalid pattern in the look behind.

Replacing (?<=.*) with (?<=.) yields an answer.

Similar issues occur when using + in place of *.

Why does the * repetition metacharacter cause an error to be thrown?

Using Ruby 2.5.0.

Aaron Thomas
  • 5,054
  • 8
  • 43
  • 89

0 Answers0