1.javascript-Regular Expression Basics

Source: Internet
Author: User
Tags modifiers

JavaScript RegExp Objects

One. RegExp Object

A regular expression is an object that describes a character pattern.

Regular expressions are used to match string patterns and retrieve replacements, and are powerful tools for performing pattern matching on strings.

1. Syntax

1 var patt=New RegExp (pattern,modifiers);  // Mode 1 var patt=/pattern/modifiers;            // Mode 2

*pattern (Mode) describes the pattern of an expression

*modifiers (modifier) for specifying global matches, case-sensitive matching, and multi-line matching

2. Modifiers

Modifiers are used to perform case-sensitive and global matching

3. Meta-Characters

Metacharacters is a character with a special meaning.

4. quantifiers

5. Square brackets

Square brackets are used to find characters in a range

Two. RegExp Object methods

1. Basic methods

2. String method that supports regular expressions

  

1.javascript-Regular Expression Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.