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". Quote 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*\()/ Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.