Closed Bug 165349 Opened 22 years ago Closed 13 years ago

add /s flag support to JS Regexp object ("Treat string as single line")

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dmosedale, Unassigned)

Details

I'm doing some JS work with a big set of regular expressions, a sizable chunk of which depend on the /s ("single-line") flag for Regexps, which JS doesn't currently support. The perlre manpage from Perl 5.6.1 has the following to say about /m, /s, and how they interact: m Treat string as multiple lines. That is, change "^" and "$" from matching the start or end of the string to matching the start or end of any line anywhere within the string. s Treat string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match. The "/s" and "/m" modifiers both override the "$*" setting. That is, no matter what "$*" contains, "/s" without "/m" will force "^" to match only at the beginning of the string and "$" to match only at the end (or just before a newline at the end) of the string. Together, as /ms, they let the "." match any character whatsoever, while still allowing "^" and "$" to match, respectively, just after and just before newlines within the string. Waldemar: so it looks like I was wrong, and this does effect ^ and $. Would you still consider a patch for this?
Severity: normal → enhancement
Status: NEW → ASSIGNED
Depends on: RegExpPerf
Pure RFE, probably not worth keeping around given how ECMA-262 is going. Maybe not relevant in light of perl6? /be
No longer depends on: RegExpPerf
QA Contact: pschwartau → general
Assigning bugs that I'm not actively working on back to nobody; use SearchForThis as a search term if you want to delete all related bugmail at once.
Assignee: dmose → nobody
Status: ASSIGNED → NEW
Summary: add /s flag support to JS Regexp object → add /s flag support to JS Regexp object ("Treat string as single line")
Closing--JS language extensions belong to TC39, not us.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.