fork download
  1. <?php
  2.  
  3. $re = "/(?:
  4. (\\((?>[^()]|(?1))*\\)) # Match (..(.)) like substrings
  5. |
  6. ({(?>[^{}]|(?2))*}) # Match {{.}..} like substrings
  7. )
  8. (*SKIP)(*F) # Ignore the texts matched
  9. |
  10. (?:FIRSTNAME|LASTNAME|PHONE|EMAIL)/x";
  11. $str = "FIRSTNAME LASTNAME PHONE EMAIL {FIRSTNAME LASTNAME PHONE EMAIL{FIRSTNAME LASTNAME PHONE EMAIL }FIRSTNAME LASTNAME PHONE EMAIL }";
  12. $n = preg_replace($re, "", $str);
  13. echo $n;
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
    {FIRSTNAME LASTNAME PHONE EMAIL{FIRSTNAME LASTNAME PHONE EMAIL }FIRSTNAME LASTNAME PHONE EMAIL }