a Regex pattern is reported as syntax error by Rhino

RESOLVED WORKSFORME

Status

RESOLVED WORKSFORME
11 years ago
7 years ago

People

(Reporter: emichaelb, Assigned: norrisboyd)

Tracking

Details

(URL)

(Reporter)

Description

11 years ago
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)

Updated

10 years ago
Assignee: nobody → norrisboyd
(Assignee)

Updated

10 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 1

7 years ago
The pattern works in all recent versions of Rhino I've tried it with (including 1.7R3 and current git).
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.