Closed Bug 410281 Opened 17 years ago Closed 13 years ago

a Regex pattern is reported as syntax error by Rhino

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: emichaelb, Assigned: norrisboyd)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Build Identifier: 

patt=/((ftp:\/\/|http:\/\/|https:\/\/|ftp:\/\/www\.|http:\/\/www\.|https:\/\/www\.|www\.)(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))/gi;
 }}}

When Peller at Dojo entered my regex pattern shown above (which matches urls and works nicely in javascript) in plain Rhino (including the latest release) it comes back with a syntax error on the "~" near the end.

Reproducible: Always

Steps to Reproduce:
1. I found this using Shrinksafe online, which outputs "null" with any script containing this line of code.
2. Peller at Dojo entered in "plain Rhino", but I know nothing about how that is done.
3.
Actual Results:  
"a syntax error on the "~" near the end."
Assignee: nobody → norrisboyd
Status: UNCONFIRMED → NEW
Ever confirmed: true
The pattern works in all recent versions of Rhino I've tried it with (including 1.7R3 and current git).
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.