not contained. For example, "[^ABC]" can match "Plin" in "plain".
[A-z]
The character range. Matches any character within the specified range. For example, "[A-z]" can match any lowercase alphabetic character in the range "a" to "Z". Note: The range of characters can be represented only if the hyphen is inside a character group and appears between two characters; If the beginning of the character group is out, only the
]" can match "Plin" in "plain".
[A-z]
The character range. Matches any character within the specified range. For example, "[A-z]" can match any lowercase alphabetic character in the range "a" to "Z".Note: The range of characters can be represented only if the hyphen is inside a character group and appears between two characters; If the beginning of the character group is out, only the hyphen
direction. For example "(?
X|y
Match x or Y. For example, "Z|food" can match "Z" or "food" (please be cautious here). "(z|f) Ood" matches "Zood" or "food".
[XYZ]
The character set is combined. Matches any one of the characters contained. For example, "[ABC]" can Match "a" in "plain".
[^XYZ]
Negative character set. Matches any character that is not contained. For example, "[^ABC]" can match "Plin" in "plain".
[A-z]
The
direction.For example "(? However, "Windows" in "2000Windows" cannot be matched. This place is not right, it's a problem.There can be no more than 2 bits, such as "(? "(? Ditto, here in python3.6 the string length in the RE module should be consistent, not necessarily 2,For example, "(?
X|y
Match x or Y. For example, "Z|food" can match "Z" or "food" (please be cautious here). "[Zf]ood" matches "Zood" or "food".
[XYZ]
The character set is combined. Matches
within the specified range. For example, "[A-z]" can match any lowercase alphabetic character in the range "a" through "Z".Note: The range of characters can only be represented when the hyphen is inside the character group and occurs between two characters; If the beginning of a group of characters, only the hyphen itself is represented.
[^a-z]
Negative character range. Matches any characte
(): a = 1 b = 2 return a + bAfter running, immediately error File "The solution, very simple, is to adjust the indentation to a uniform 4 spaces just fine.Punctuation SyntaxErrorThe situation here is more, common for
Colon error
Comma error
Parentheses missing or mismatched
Take a look at the specific error style def Test (): Pass File "Modify the way is very simple, the punctuation in the code is English, there are gram
$, then it matches any string that contains the pattern. For example: pattern once with string there once is a man from newyorkwho kept all of his cash in a bucket. is a match. The letters in the pattern (O-N-C-E) are literal characters, that is, they represent the letter itself, and the numbers are the same. Some other slightly more complex characters, such as punctuation and white characters (spaces, tabs, etc.), are used to escape sequences. All e
the pattern matches only those strings that start with once. This pattern, for example, matches the string "Once Upon a Time" and does not match the "There once was a mans from NewYork". Just as the ^ symbol indicates the beginning, the $ symbol is used to match the strings that end in the given pattern.
bucket$
This pattern matches the "who kept all of the this cash in a bucket" and does not match "buckets". Characters ^ and $ are used at the same time to represent exact matches (strings are
,
(?
Non-get match, reverse negative pre-query, similar to forward negative pre-query, only in the opposite direction. For example, "(?
X | y
Match x or y. For example, "z | food" can match "z" or "food" (Be cautious here ). "[Zf] ood" matches "zood" or "food ".
[Xyz]
Character Set combination. Match any character in it. For example, "[abc]" can match "a" in "plain ".
[^ Xyz]
Negative value character set combination. Match any character not incl
placed in a regular expression has no special meaning.^(caret) matches an empty string that appears at the beginning of a line or string.ERE: placed in any position with special meaning;BRE: This special meaning is only at the beginning of a regular expression.$Matches an empty string that appears at the end of the row.ERE: placed in any position with special meaning;BRE: This special meaning is only at the end of a regular expression.[...]A square bracket expression that matches any one of the
About regular ExpressionsA regular expression can be matched by a meta-character (rule) to find the associated character set. There is a difference between him and the wildcard character. and the relevant use of tools for the regular expression of the metacharacters is different.First, let's look at the common metacharacters and meanings (not all metacharacters), mainly using grep in bash as a mechanism.Character matching. (dot) An arbitrary character, except for a carriage return line character
Write mathematical formulas in Word. The commonly used formula editor is Mathtype. Many people do not know how to add spaces to the formula, because there is no space option in the Mathtype menu. The input method is Ctrl + Alt + space. Press Ctrl + Alt and Press space multiple times to enter multiple spaces consecutively.
Common Mathtype shortcut keysAs a matter of fact, you will find that mathtype does not need to be clicked with the mouse, most of them should have a keyboard operation, which i
Common characters
A common character consists of all the print and non-print characters that are not explicitly specified as metacharacters. This includes all uppercase and lowercase letter characters, all numbers, all punctuation marks, and some symbols.
The simplest regular expression is a single normal character that can match the character itself in the searched string. For example, the single-Character Mode 'A' can match the 'A' letter that appea
characters can be represented only if the hyphen is inside a character group and appears between two characters; If the beginning of the character group is out, only the hyphen itself can be represented.
[^a-z]
A negative character range. Matches any character that is not in the specified range. For example, "[^a-z]" can match any character that is not in the range "a" to "Z".
times{m}Exactly match M-Times{m,}Matches at least m times{m, n}Matches at least m times but not more than n timesTable 3: Pre-defined POSIX character classesCharacter classDescription[: Alpha:]Alphabetic characters[: Lower:]Lowercase alphabetic characters[: Upper:]Uppercase characters[:d Igit:]Digital[: Alnum:]Alpha-Numeric characters[: Space:]White space characters (prohibit printing), such as carriage returns, line feeds, vertical tabs, and page breaks[:p UNCT:]
regular expressions in Jscript and VBscript
A regular expression is a text mode consisting of common characters (such as characters a to z) and special characters (such as metacharacters. This mode describes one or more strings to be matched when searching the text subject. A regular expression is used as a template to match a character pattern with the searched string.
Here are some examples of regular expressions that may be encountered:
Jscript VBscript matching/^ \ [\ T] * $/"^ \ [\ t] * $"
expressions is the same, they all match a non-numeric character ." "^" In [] "is the inverse, excluding the content after" ^.
Matching word and non-word characters:
First, it must be emphasized that the matching is a word and a non-word character, not a word !!!
The abbreviated "\ W" will match all the characters (letters, numbers, and underscores )."\ D" matches non-numeric characters, including spaces, punctuation marks (quotation marks, hyphens, b
1. ""--exact matchIf the input query word is very long, Baidu after analysis, given the search results in the query words, may be split. If you are not satisfied with this situation, you can try to let Baidu do not split the query word. This effect can be achieved by adding double quotation marks to the query words. such as: "Shanghai University", the search results of Shanghai University four words will not be separate.2. (-)--Elimination of extraneousThe logical "not" operation, which is used
pattern matches only those strings that begin with once. For example, the pattern matches the string \ "Once Upon a Time\", and the \ "There once is a man from Newyork\" does not match. Just as the ^ symbol represents the beginning, the $ symbol is used to match strings that end in a given pattern.
bucket$
This pattern matches the \ "who kept-cash in a bucket\" and does not match \ "Buckets\". The characters ^ and $ are used together to indicate exact matches (the string is
regular expression constructorText Format:/pattern/flagsRegular expression constructors: New RegExp ("pattern" [, "flags"]);Parameter description:Pattern--a regular expression textFlags--if present, will be the following values:G: Global MatchI: Ignore caseGI: Above combinationM: Multi-line matching[note] The parameters of the text format are not quoted, and the arguments that are used when using the constructor require quotation marks.1 Direct Volume charactersWe have found that all alphabetic
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.