
- 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
Regular expression to match numbers only in JavaScript?
You can try to run the following code to implement regular expressions for matching only numbers −
Example
<html> <head> <title>JavaScript Regular Expressions</title> </head> <body> <script> var myStr = "5200% Demo"; var reg = /\d/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>
- Related Questions & Answers
- How to match only digits in Python using Regular Expression?
- How to match only non-digits in Python using Regular Expression?
- How to put variable in regular expression match with JavaScript?
- How to match parentheses in Python regular expression?
- MongoDB regular expression to match a specific record?
- Explain Python regular expression search vs match
- PHP – Match regular expression using mb_ereg_match()
- How to use regular expression in Java to pattern match?
- How to match a regular expression against a string?
- How to match digits using Java Regular Expression (RegEx)
- How to match a word in python using Regular Expression?
- How to match nonword characters in Python using Regular Expression?
- How to match a whitespace in python using Regular Expression?
- How to match non-digits using Java Regular Expression (RegEx)
- Regular Expression Matching in JavaScript
Advertisements