rauschma / exploring-es2018-es2019

8 stars 0 forks source link

Chapter: `s` (`dotAll`) flag for regular expressions #6

Open rauschma opened 6 years ago

rauschma commented 6 years ago

http://exploringjs.com/es2018-es2019/ch_regexp-dotall-flag.html

aickin commented 6 years ago

Thanks for this book and all you do!

This might just be me, but I found the first paragraph of this chapter pretty confusing:

Currently, the dot (.) in regular expressions doesn’t match line terminator characters:

/^[^]$/.test('\n') true

I was confused because the example code doesn’t try to use a dot in the regex at all. It was extra confusing for me since I didn’t know about the [^] hack, which you ably explain later in the chapter.

I may well be missing something, so take it as one person’s experience, and thanks again for spreading knowledge!

rauschma commented 6 years ago

@aickin Yes, that was a typo. Fixed now, thanks!

vsemozhetbyt commented 6 years ago

Small typo: "The following for characters" -> "The following four characters".

nicothed commented 5 years ago

I believe there's a small typo ("termators"): "Line termators in ECMAScript affect"

dandv commented 5 years ago

Another one, "nor not"