Regular expression help

by 1 replies
2
Am trying to get tags that start
<a has what ever in between, doesn't include a string and has an end </a> |

my code is

preg_match_all("/<a.*(?<!name\.cfm)</a> |/", $html, $matching_data);

the ending parameter </a> | seems to grab loads of line breaks, the (?<!name\.cfm) just doesn't seem work as code grabbed my the reg expression contains name.cfm.


Any ideas?
#programming #expression #regular
  • Try escaping the backslash

    preg_match_all("/<a.*(?<!name\.cfm)<\/a> |/", $html, $matching_data);

    Can't test it right now for you... just a thought.

Next Topics on Trending Feed