Zhadus Posted January 19, 2009 Share Posted January 19, 2009 Thanks for reading, Anyway I need help with some regex, here is the pattern I have so far: (\b[^\s]+\b\s*\() Which will identify terms such as: blah( scien ( examp ( What I want it also to negate, are the terms: if ( elseif ( Basically the term itself should not be if or elseif. I'm having trouble changing the [^\s] (No white space in the term) to also include no matching of the strings "if" and "elseif". Link to comment https://forums.phpfreaks.com/topic/141489-solved-using-negation-and-alteration-in-regex/ Share on other sites More sharing options...
effigy Posted January 19, 2009 Share Posted January 19, 2009 /(\b(?!(?:else)?if)\S+\b\s*\()/ Link to comment https://forums.phpfreaks.com/topic/141489-solved-using-negation-and-alteration-in-regex/#findComment-740600 Share on other sites More sharing options...
Zhadus Posted January 19, 2009 Author Share Posted January 19, 2009 Thank you so much. I have some more learning to do I see. Link to comment https://forums.phpfreaks.com/topic/141489-solved-using-negation-and-alteration-in-regex/#findComment-740610 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.