• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 20. The RegExp Object: Working w... > Regular Expressions: Quantifiers

Regular Expressions: Quantifiers

What if you want to match an unknown number of characters? For example, what if you’re trying to match words that can vary in length? You can do that with quantifiers.

For example, the pattern \w matches a single-word character (any alphanumeric character and “_”). To match one or more word characters in succession (that is, a whole word), you can use the expression \w+, because + is a quantifier that means “one or more of.”


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint