

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find word character in a string with JavaScript RegExp?
To find a word character (a-z, A-Z, 0-9, _) in a string with JavaScript Regular Expression, use the following −
\w
Example
You can try to run the following code to find word character in a string −
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "100% Responsive!"; var reg = /\w/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>
- Related Questions & Answers
- Find non-word character in a string with JavaScript RegExp.
- With JavaScript RegExp find a character except newline?
- Find a new line character with JavaScript RegExp.
- Find a form feed character with JavaScript RegExp.
- With JavaScript RegExp search a tab character.
- With JavaScript RegExp search a vertical tab character.
- With JavaScript RegExp search a carriage return character.
- With JavaScript RegExp search a hexadecimal number character.
- Find digit with JavaScript RegExp.
- How to find character between brackets in JavaScript RegExp?
- With JavaScript RegExp search an octal number character.
- How to find a character, not between the brackets in JavaScript RegExp?
- With JavaScript RegExp how to search a string for text that matches regexp?
- How to search specific word in MySQL with RegExp?
- How to skip character in capture group in JavaScript Regexp?
Advertisements