Adding DOTALL modifier to ECMAScript regex standards
jreynoldsdev at gmail.com
Wed Aug 10 14:13:54 UTC 2016
Correct, sorry about that. I should have verified in a regexr before
typing up the examples.
On Wed, Aug 10, 2016 at 9:12 AM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:
> Just to double check, your `/he[\d\D]?llo/` should be `/he[\d\D]*?llo/`,
> Otherwise it's not the same as `/he[.*]?llo/`
> On Wed, Aug 10, 2016 at 3:02 PM, Jake Reynolds <jreynoldsdev at gmail.com>
>> I brought up the topic of adding the DOTALL modifier to the Chrome V8
>> Engine here
>> <https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/K9h0qB3Z3Gw> and
>> was directed to es-discuss. I was curious about the practicality and the
>> want for adding a DOTALL modifier to the ECMAScript standards in the future?
>> For those that don't know that DOTALL modifier is a regex modifier that
>> allows the '.' symbol to match newlines as well.
>> *Example regex:* /he[.*]?llo/
>> *Example search string 1: *hello
>> *Example search string 2: *he
>> The above regex will match the 1st search string but will not match the
>> In ECMAScript the only current way to make a match like that work is to
>> use [\d\D] which will match everything including newlines, given below.
>> *Current workaround regex: */he[\d\D]?llo/
>> The *s* modifier is the standard in most major languages except
>> The proposed regex is below:
>> *Proposed new regex: */he[.*]?llo/s
>> *Example search string: *he
>> Let me know if there is any more information I can provide, or any
>> questions you have.
>> Thanks much,
>> es-discuss mailing list
>> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss