Regex Pattern

Discussion in 'Developers' Forum' started by Horfic, Jan 12, 2010.

  1. Horfic

    Horfic Member

    I'm having troubles figuring the regex pattern out for this here:
    cc “[email protected]

    The email is changing the cc “{email}” stays always the same.

    So what would it be so I can extract the email out of this string.

    PS: This is just an extract from the custom_mailfilter, so there is more text around it.
  2. Ben

    Ben ISPConfig Developer ISPConfig Developer

    maybe this gives you a hint:


    "asdasasasd cc \"[email protected]\"  asdasdasdsad";

    preg_match("/cc \"(.*)\"/"$str$matches) ) {
    else {
    //String was not found

    where $matches[1] would be the string within "". You might also think of using another regex to match a more or less real syntax for emailadresses instead of matching any string between "" ( -> (.*) ).

Share This Page