Transcript from the "dotall Mode" Lesson
>> Kyle Simpson: Third feature that is gonna be a big deal in certain use cases, that was added in ES 2018, is what is called the .all mode. Specifically, it's a new flag that you can add onto the end of your regular expression. So in addition to having g for global, and m for multiline, and i for case insensitive, and those sorts of flags, there's a new flag called s.
[00:00:50] So you're only able to match on that exact line, which is why the code on line 6 doesn't find any match. Because it can't find brown and over, since the dot in that dot-star can't span across a newline. If we then turn on the dot all mode, the dot is able to match all characters, including new lines.
[00:01:13] So now, we're able to make regular expression matches across lines.
>> Kyle Simpson: Just three of a variety of changes that have either landed, or are landing soon. Another couple of features, or another regular expression feature that landed, not something that a lot of you will use, but a new flag that was added, which is slash u, and it turns on Unicode-aware mode for your regular expressions.
[00:02:05] But a bunch of really cool stuff that has landed, and is landing in regular expressions, is finally gonna bring this feature up to more parity with regular expression support in other languages. And that should hopefully bring some needed relief to all the frustration that we have. We naturally don't love writing regular expressions, at least most of us.
[00:02:26] But it should bring some very necessary relief to those problems. Any questions about these additions, or improvements to regular expressions?