常用正则表达式(Regular expressions).docVIP

  • 3
  • 0
  • 约1.28万字
  • 约 13页
  • 2017-10-06 发布于河南
  • 举报
常用正则表达式(Regular expressions)

常用正则表达式(Regular expressions) Matches the start position of the input string. If you set the Multiline attribute of the RegExp object, ^ matches the position after\nor\r. $matches the end position of the input string. If the Multiline property of the RegExp object is set, $matches the location before\nor\r. * matches the previous sub expression zero or more times. For example, zo* can match Z and zoo. * equivalent to {0}. + matches the previous sub expression one or more times. For example,zo+matches Zo and zoo, but does not match Z. + is equivalent to {1}. Matches the previous sub expression zero or twice. For example, do (ES) can match the do in do or does. Equivalent to {0,1}?. {n} n is a nonnegative integer. Match the specified n times. For example,o{2}does not match theo in Bob, but it matches the two o in food. {n,} n is a nonnegative integer. Match at least n times. For example,o{2,}cannot match Bob ino, but can match all o in foooood. o{1,}is equivalent too+. o{0,}is equivalent too*. {n, m} m and N are non negative integers, n = M. Match n times at least, and match m times at most. For example, o{1,3} will match the first three o in fooooood. o{0,1}is equivalent toO?. Note that there is no space between commas and two numbers. When the character is followed by any other qualifier (*, +,,,, {n}, {n,}, {n, m}), the matching pattern is non greedy. The non greedy pattern matches the search string as little as possible, whereas the default greedy pattern matches the search string as much as possible. For example, for string oooo, o+ will match a single o, ando+will match allo. Matches any single character other than \n. To match any characters, including\n, use the[.\n] like pattern. (pattern) match pattern and get the match. The resulting matches can be obtained from the resulting Matches collection, using the SubMatches collection in VBScript, and $0 in JScript... $9 property. To match the parenthesis characters, please use (or \ \). (:: pattern) matches patter

文档评论(0)

1亿VIP精品文档

相关文档