P
Phrogz
Given a string like this:
"this.position.x = foo.bar.whee * jim.jam - yow / this.jorgle"
I want to match all the global identifiers which are not 'this', and I
'need' to do so without consuming any other characters.
This regexp:
/[^.]\b(?!this)[a-zA-Z_]\w*\b/
works, but it consumes the preceding character.
I thought this regexp would work:
/(?!\.)\b(?!this)[a-zA-Z_]\w*\b/i
but now I realize why it doesn't. (Because the position after the
period satifies the negative lookahead and the word boundary.)
Help?
"this.position.x = foo.bar.whee * jim.jam - yow / this.jorgle"
I want to match all the global identifiers which are not 'this', and I
'need' to do so without consuming any other characters.
This regexp:
/[^.]\b(?!this)[a-zA-Z_]\w*\b/
works, but it consumes the preceding character.
I thought this regexp would work:
/(?!\.)\b(?!this)[a-zA-Z_]\w*\b/i
but now I realize why it doesn't. (Because the position after the
period satifies the negative lookahead and the word boundary.)
Help?