JavaScript RegExp \w Metacharacter
JavaScript RegExp Object
Definition and Usage
The \w metacharacter is used to find a word character.
A word character is a character from a-z, A-Z, 0-9, including the _ (underscore) character.
Syntax
new RegExp("\w")
or simply:
/\w/ |
Browser Support

The \w metacharacter is supported in all major browsers.
Example
Example
Do 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:
Try it yourself »
|
JavaScript RegExp Object
Start Creating a stunning, Flash website. It's easy and free!
Wix.com offers you a simple, powerful, drag & drop editing platform to create stunning Flash websites, layouts, and more.
With added e-commerce features such as search engine visibility and professional tools, Wix is the ultimate solution for creating a spectacular site.
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4500 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|