Regular expression match *abc* but not *bc*abc*bc*
expression, regex
Solution
I have no idea how general you needed this solution to be, but the following works for your example:
(?!.*(?<!quest)ion)^.*question.*$
RegExr Example
Problem
I'm trying to find a regular expression to match all the combination of chars that have the string "question" but not have or contain the string "ion". examples: `questionxxxx ------> match` `xxxquestion--------> match` `questionxxxxion----> not match` `xxxquestionxxx-----> match` `xxxionxxxquestion--> not match` I'm almost there but is missing me something!!! this is what I have done: `((?=.*question(?!.*ion.*).).*)|^question$` This expression exclude all the strings with "ion" separated from "quest" but unfortunately also exclude "xxxquestion"