Need help with Preg_Match

by 3 replies
4
I use this to get emails off of a web page, but some school emails have a / . I don't understand preg_match well enough to add a / to acceptable charters. Even after looking at examples online I had trouble with it.


Code:
$var = preg_match_all(
"/[a-z0-9]+[_a-z0-9.-]*[a-z0-9]+@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})/i",$body,$matches);

Thanks for your help,

Rick
#programming #pregmatch
  • Come on folks, I give back when I can. A little help here...?

    Rick
    • [1] reply
    • The forum is quiet on the weekends and that might be the lack of answers. Great to see you figured out your problem. Another place to try in the future would be github. Programs hang out there and might and been quicker to answer. Heres a link if you need more help in the future. https://github.com/
      • [ 1 ] Thanks
  • got it just had to cancel it out \

Next Topics on Trending Feed

  • 4

    I use this to get emails off of a web page, but some school emails have a / . I don't understand preg_match well enough to add a / to acceptable charters. Even after looking at examples online I had trouble with it.