You will need to change three things
- need to add pattern delimiters (can be any character, but most commonly a forward slash)
- [[:alnum:]] will need to be replaced with the PCRE equivalent
- The "i" in "eregi" means case-insensitive, which PCRE does with a flag, specifically the
i flag.
Otherwise, the rest looks PCRE compatible (yes, that's kind of redundant =P)
"/^[a-z0-9][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i"