
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to match a regular expression against a string?
Use the match() method to match a regular expression against a string in JavaScript. You can try to run the following code to match a regular expression −
The following is the parameter −
- match( param ) − A regular expression object.
Example
You can try to run the following code to match a regular expression against a string −
<html> <head> <title>JavaScript String match() Method</title> </head> <body> <script> var str = "For more information, see Chapter 3.4.5.1"; var re = /(chapter \d+(\.\d)*)/i; var found = str.match( re ); document.write(found ); </script> </body> </html>
- Related Articles
- How to query an Array[String] for a Regular Expression match?
- How do we use Python regular expression to match a date string?
- Program to match vowels in a string using regular expression in Java
- MongoDB regular expression to match a specific record?
- How to match a word in python using Regular Expression?
- How to match a whitespace in python using Regular Expression?
- How to match a nonwhitespace character in python using Regular Expression?
- How to match a single character in python using Regular Expression?
- How to match parentheses in Python regular expression?
- How to write a Python regular expression to match multiple words anywhere?
- How to match at the beginning of string in python using Regular Expression?
- How to write a regular expression to match either a or b in Python?
- How to match digits using Java Regular Expression (RegEx)
- How to use regular expression in Java to pattern match?
- How to match at the end of string in python using Regular Expression?\n\n

Advertisements