+
Right now you’re probably thinking “Woooooooooow! Regular expressions are amazing!” Well, maybe you’re not quite that excited about it, but guess what? Regular expressions can handle it, no matter how excited you are. In Regular Expression Land, the + tells the regular expression to match the preceding character one or more times. See Listing 6.6.
Listing 6.6 Regular Expressions Can Handle All Levels of Excitement
> var excitementPattern = /Wo+w/; /Wo+w/> var notYetExcited = 'Wow... Regular Expressions are weird :/'; "Wow... Regular Expressions are weird :/"> excitementPattern.exec(notYetExcited); ["Wow"]> var startingToGetExcited = 'Wooow. Regular Expressions are... pretty cool.'; "Wooow. Regular Expressions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access