0

Possible Duplicate:
Converting ereg expressions to preg

I downloaded the Ocomon and edit the languages ​​appeared: Deprecated: Function ereg() is deprecated. So, I researched and talked about what I should change for preg_match (), but gave the following error: Delimiter must not be alphanumeric or backslash.

The code is this:

ereg("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$email)
Community
  • 1
  • 1

1 Answers1

1

You need delimiters around your regular expression. Forward slashes are typical:

"/^[0-9a..........{2,3}$/"

As it stands, the regular expression engine things you're tying to use ^ as your opening delimiter, which is not allowed.

user229044
  • 232,980
  • 40
  • 330
  • 338
  • But you will want to make sure that you escape `/` as `\/` (if there are any) inside the regexp or you will experience even weirder errors. ;-) – PhilMasteG Aug 19 '12 at 02:55