Parameters: This method accepts single parameter regexp which is required. It is used to pass the value to search for as a regular expression.
Regular expression (regexp): It is a particular syntax /pattern/modifiers; modifier sets the type. For example /GeeksforGeeks/i where “i” sets to case insensitive.
Note: Here g and i used for global and case-insensitive search respectively.
Example 1: This example describes the search of a regular expression.
- Before clicking on the button:
- After clicking on the button:
Example 2: This example describes the search of a regular expression.
- Before clicking on button
- After clicking on button:
- Scala | Case Class and Case Object
- How to use a switch case 'or' in PHP?
- case command in Linux with examples
- PHP | Check if all characters are lower case
- How to change Input characters to Upper Case while typing using CSS/jQuery ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.