Author Topic: Perl regex problem  (Read 57 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1496
  • Hero Points: 124
  • Text
Perl regex problem
« on: May 16, 2018, 06:59:14 pm »
I found regex pat1 doesn't match case 2, but does match case 1.
pat2 matches case2 but not case3.

https://regex101.com shows it should match both.
Python re also matches.

Code: [Select]
pat1: "([0-9]*?)(18)"
pat2" "([0-9]{3,4})(18)"
case1: "4918 116"
case2: "514918 116"
case3: "51918 116"