
- 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
Which is the JavaScript RegExp to find any alternative text?
To match any of the specified alternatives, follow the below-given pattern −
(foo|bar|baz)
Example
You can try to run the following code to find any alternative text −
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "one,one,one, two, three, four, four"; var reg = /(one|two|three)/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>
- Related Articles
- With JavaScript RegExp how to search a string for text that matches regexp?
- Is their any alternative to HTML5 iframe srcdoc?
- Find digit with JavaScript RegExp.
- Is there any alternative for CONCAT() in MySQL?
- How to find character between brackets in JavaScript RegExp?
- Find digits between brackets in JavaScript RegExp?
- How to find a character, not between the brackets in 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.
- Is there any alternative solution for static constructor in java?
- Is there any alternative for OpenCV imshow() method in Java?
- Match any string containing one or more p's with JavaScript RegExp.
- Find word character in a string with JavaScript RegExp?
- Alternative shuffle in JavaScript

Advertisements