Hi,
i use reg. exp. very often, but i would'nt expect that the following would be such a problem: how to negate a whole word ?
i have some files with underscore, file_1, file_2, i'm processing a text to find a file_n following by a keyword:
preg_match ("/file_1.+keyword/", $string, $regs);
But now i have several newlines and there is no rule for theire occurence, so i have to search with
preg_match ("/file_1.+keyword/s");
the problem now is, that in the text
file_1 xyz
file_2 xyz keyword
that matches for file_1 AND file_2, but should only for file_2. I tried to do it with assertions, something like
"file_1" not followed by "file_" keyword<
but it doesn't work, so how can i solve it ? (I can't adjust the string to the right format first because the application stands and works, the reg. exp. are added via configuration-file)
thanks a lot