
- 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
Match any string with p at the beginning of it.
To match any string with p at the beginning of it with JavaScript RegExp, use the ^p Quantifier −
Example
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "Welcome to our website. We Learners!"; var reg = /^We/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>
- Related Articles
- Match any string with p at the end of it.
- Match any string containing at most one p.
- Match any string containing a sequence of at least two p's.
- How to match at the beginning of string in python using Regular Expression?
- Match any string containing one or more p's with JavaScript RegExp.
- Match any string containing a sequence of N p's
- Match any string containing zero or more p's.
- Match any string containing a sequence of two to three p's.
- How to match beginning of a particular string/line using Java RegEx
- Align flex items at the beginning of the container with CSS
- How to match the beginning of the input using Java RegEx?
- Insert the string at the beginning of all items in a list in Python
- Find the player who is the last to remove any character from the beginning of a Binary String
- How to trim a string at beginning or ending in JavaScript?
- Program to find the indexes where the substrings of a string match with another string fully or differ at one position in python

Advertisements