![]() |
Regular expression question
Using php I would like to detect something in a string depending on whether the part immediately after the matched part does not contain certain characters. I think I may need to use a lookahead negative assertion as explained here but it is not working as I would expect so not sure. So for example:
Code:
$string = 'test aadfadf random text kalkdfjakdf>apple peach orange'; I tried Code:
if(preg_match("/test(.*)>(?!apple))/i",$string)){ |
try stackoverflow, i do the same and get issues solved within minutes...
first thing make sure you have regex part correct ... and then the php is the very easy. |
ha, I did endup there and your right got answer right away, had an extra parenthese at the end. Thanks for the reply.
|
Quote:
|
All times are GMT -7. The time now is 05:20 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc