0

In one codebase (PHP) I'm working on currently there is this regular expression:

!([a-z0-9]*)\.([a-zA-Z0-9]{3,4})

Which supposedly should match something like this:

a1213asddaa13124312ada.12ws

And yet it does not happen. Matching occurs only with this expression:

([a-z0-9]*)\.([a-zA-Z0-9]{3,4})

Can anybody clarify?

Darko Miletic
  • 678
  • 1
  • 7
  • 14

1 Answers1

1

! has no special meaning. It'll match a literal exclamation mark. a1213asddaa13124312ada.12ws does not start with one.

John Kugelman
  • 307,513
  • 65
  • 473
  • 519