Answer the question
In order to leave comments, you need to log in
How to teach a regular expression so that preg_match_all looks for strings where there is no subpattern?
For example, there is a regular expression
"^.*<a.*$"
which searches for all lines with links.
How to make such an expression so that preg_match_all gives out all lines where there are no links?
UPD The problem is that I can't use anything other than a regular expression, the script is obfuscated. You can't implement your own logic.
Miraage , I'm not sure, because I don't see the logic, but it searches line by line in the file. That is, it is quite possible that there he scours the file and checks preg_match for each line.
Answer the question
In order to leave comments, you need to log in
/ Everybody stand back /
i know regular expressions
Regular expressions:
/^(?>(?!(\<a.*href)|\<\/a).)*$/umi
Example:
ideone.com/g5vDT
Example source
:
pastebin.com/ZkWguPS2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question