|
Re: Eclipse's Rhino JavaScript RegEx Not Working [message #838735 is a reply to message #837487] |
Sat, 07 April 2012 15:01 |
Tonté Pouncil Messages: 13 Registered: July 2009 |
Junior Member |
|
|
All,
I figured out what my problems was. It turns out that the white space in "\s" in JavaScript Regular Expression considers a whitespace to be more than just the whitespace character. It includes characters such as:
- A tab character
- A carriage return character
- A new line character
- A vertical tab character
- A form feed character
And it turns out I need to only to search for the whitespace, only. In order to learn this, I had to use the unicode equivalent of the space character; which is [\u0020] in my regular expression. So I end up with the following revised regular expression:
this\.[a-zA-Z][a-zA-Z0-9]*[\u0020]+=[\u0020]+function[\u0020]*
I hope this tid-bit of information helps someone else.
Cheers!
Tonté
[Updated on: Sat, 07 April 2012 15:03] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02586 seconds