I am stuck in a problem with an application. I have following lines of text :
1) hi {my|your|his} name is {stacker|monster|overflow}
2) hi {my|your|his} job can be to {stacker|monster|overflow}
3) hi {my|your|his} car {stacker|monster|overflow}
What I want :
on the click of a button select and replace those words which do not have { or } just before or after the word i.e. in line 1 or 3 we do not have any such word. In line 2 we have “can” and “be”.
I used substrings to check for { or } but it does not work. I thought there might be a regex to check for such words?
Thanks and happy new year. Quite sweet that you guys are helping on new year day 🙂
does this.
Explanation:
Caveat: This fails if braces can be nested.