0

This is the string i'm working with 8 August 1994 (age 25 years) I've been trying to match the 25 using

(?<=age ).*?(?= years),

but it returns
Evaluation failed: TypeError: Cannot read property '0' of null

It matches fine on regex101.com https://regex101.com/r/P5JYKx/2, so I don't understand the issue?

code

string.match(/(?<=age ).*?(?= years)/)

I'm using javascript regex.

srb633
  • 793
  • 3
  • 8
  • 16

0 Answers0