Reputation: 6041
I have a block of text and each word in it, that starts from underscore should be replaced with another unique string.
For example:
_word -> _a
_anotherword -> _b
_another_word -> _c
._dotwithword -> ._d
[_brword] -> [_e]
another_word -> another_word (should stay the same)
I'm using this regex to find them - (_\w+) , and it replaces everything correctly, except the last one if underscore is in the middle of the word. Is there any way to check this via JS regex?
JS fiddle to test: http://jsfiddle.net/C93bs/3/
Thanks a lot!
Upvotes: 2
Views: 527