Regular expression 1

xiaoxiao2021-03-06  170

Character Description / Tags the next character as a special character, or a primary character, or a backward reference, or an octave. For example, 'n' matches characters "n". '/ n' matches a newline. Sequence '//' match "/" "/ (" matches "(". ^ Match the input string of the start position. If the multiline property of the regexp object is set, ^ also matches '/ n' or '/ r' The next location. $ Match the end position of the input string. If the multiline property of the regexp object is set, $ also matches the position before '/ n' or '/ r'. * Match the previous sub-expression zero or multiple times For example, ZO * can match "Z" and "ZOO". * Equivalent {0,}. Match the previous sub-expression once or more. For example, 'ZO ' can match "ZO" and "ZOO" ", But do not match" Z ". Equivalent to {1,}. • Match the previous sub-expression zero or once. For example," Do (es) can match "do" or "does" "do". Is equivalent to {0,1}. {n} n is a non-negative integer. Match the N times. For example, 'o {2}' does not match 'O' in "Bob", but Match two O. {n,} n is a non-negative integer. For example, 'o {2,}' does not match "bob", but can match "at least N times. For example, 'o {2,}' does not match" Bob ". All O.'o {1,} 'in "fooood" is equivalent to' o 'o {0,}', equivalent to 'o *'. {n, m} m and n are non-negative Integer, where n <= m. Minimize n times and matched M times. Liu, "O {1, 3}" will match the top three O. 'o {0, 1}' in "foooood". Value 'o?'. Please note that there is no space between commas and two numbers? When this character is tight in any other restriction (*, ,?, {N}, {n,}, {n When M}) The matching mode is not greedy. Non-greedy patterns match the search string as little as possible, and the default greed mode is as much as possible to match the search string.

For example, for the string "OOOO", 'o ?' Will match a single "O", and 'o ' will match all 'o'. Match any individual characters other than "/ n". To match any character, including '/ n', use the mode of the '[./n]'. (Pattern) Match Pattern and get this match. The acquired matches can be obtained from the generated Matches, using the Submatches collection in VBScript, using $ 0 ... $ 9 properties in Visual Basic Scripting Edition. To match the bracket characters, use '/ (' or '/)'. (?: pattern) Match Pattern but does not acquire matching results, that is, this is a non-acquired match, not for storage. This is useful to use the "or" character (|) to combine a pattern. For example, 'industr (?: Y | iES) is a smale of' Industry | Industries'. (? = pattern) Positive to check, match the lookup string at any string of Pattern. This is a non-acquisition match, that is, the match does not need to be used later. For example, 'Windows (? = 95 | 98 | NT | 2000) can match "Windows" in "Windows 2000", but cannot match "Windows" in "Windows3 .1". The forecast does not consume characters, that is, after a match occurs, start the next matching search immediately after the last match, not starting from the character containing the pre-check. (?! pattern) negotiation, match the lookup string at any string of any mismatch at any Point WHERE A STRING NOT MATCHING POINT WHERE A STRING NOT MATCHING PATTERN. This is a non-acquired match, that is, the match does not need to be used later. For example, 'Windows (?! 95 | 98 | NT | 2000) "can match" Windows "in Windows 3.1, but cannot match" Windows "in" Windows 2000 ". The forecast does not consume characters, that is, after a match occurs, immediately start the next matching search immediately after the last match, instead of the X | Y, the X | Y is matched after the queue containing the pre-examined character.

转载请注明原文地址:https://www.9cbs.com/read-128488.html

New Post(0)