I am trying to extract the word “need” from this string.
ctl00_ctl00_ContentMainContainer_ContentColumn1__needDont_Panel1
I have tried [__]([.]?=Dont)
This is using javascript .match()
I have even tried to use http://gskinner.com/RegExr/ but just can’t solve this one. Thanks for the help!
This will accomplish what you’re looking for:
You seem to be mixing up what a character class – square brackets
[]– does, instead you should be using regular brackets().In your regex
[__]will only match a single underscore_and[.]will match a single period.