wants to learn regular expressions, understanding meta characters and ordinary characters is a must to conquer. Don't remember it. The following little editor brings you the knowledge of the regular expression meta character and the common character. Look at it together.

is based on regular expression syntax rules, and the matching pattern of regular expressions is made up of a series of characters.

. Common character:

, most characters can only describe themselves, these characters are called ordinary characters, such as all letters and numbers.

means that ordinary characters can only match characters in strings that are the same as them.

two yuan. Due to the common characters:

, with its own character can only be the same character as the regular expression of the flexibility and power matching function can not be fully displayed, so the regular expression specified in the special character of a series, these characters are not directly in accordance with the amount of characters matching, but has a special meaning, such as

are following characters:

 ^ * = $. +?!: |  / () [] {}

said that although the special meaning of the above characters have some characters, but only in certain contexts has special meaning.

if you want to match these special characters directly, need to add a backslash character () in front of the escape, for example, I want a $directly, otherwise it is required to be in a $, matching the end position. It is because of the existence of these special characters that regular expressions have powerful functions.

is called a meta character because they are the basic characters that construct a variety of regular expressions that match the complex text.

summarized above is small to give regular expression metacharacters and introduce the common character, I hope to help you, if you have any questions please give me a message, Xiao Bian will promptly reply all. Thank you for your support for the home website of the script!

This paper fixed link:http://www.script-home.com/simple-analysis-of-regular-expression-meta-character-and-common-character.html | Script Home | +Copy Link

Article reprint please specify:Simple analysis of regular expression meta character and common character | Script Home

You may also be interested in these articles!