YouTip LogoYouTip

Jsref Regexp Wordchar

# JavaScript RegExp w Metacharacter [![Image 8: RegExp Object Reference](#) JavaScript RegExp Object](#) * * * ## Definition and Usage The w metacharacter is used to find word characters. A word character is a character from a-z, A-Z, 0-9, and the underscore, including the _ (underscore) character. ## Syntax new RegExp("w") Or a simpler way: /w/ * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The w metacharacter is supported in all major browsers. * * * ## Example ## Example Perform a global search for word characters in a string: var str="Give 100%!"; var patt1=/w/g; The marked text below shows where the expression gets a match: Give 100%! [Try it yourself Β»](#) * * JavaScript RegExp Object](#)
← Jsref Regexp Nfollow NotJsref Regexp Dot β†’