I am trying to check a string using regex in PHP. if the string has a character "?" any where before a word then the regex will fail but if "?" is any where after the word then regex will pass. Like, my word is "world" and string is "Hi All? Hello World, How are you". Below are the scenarios.
- "Hi? All Hello World, How are you". will fail
- "Hi All? Hello World, How are you". will fail
- "Hi All Hello? World, How are you". will fail
- "Hi All Hello World, How? are you". will pass
- "Hi All Hello World, How are? you". will pass
- "Hi All Hello World, How are you?". will pass