再看正则表达式

下面的介绍介绍,来自wikipedia:

  In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. Regular expressions (abbreviated as regex or regexp, with plural forms regexes, regexps, or regexen) are written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.

  Many modern computing systems provide wildcard characters in matching filenames from a file system. This is a core capability of many command-line shells and is also known as globbing. Wildcards differ from regular expressions in that they generally only express very limited forms of alternation.(这里提到了和通配符的不同,正则表达式的表达能力比通配符强多了)

 Alternation

A vertical bar separates alternatives. For example, gray|grey can match " gray" or " grey".
Grouping
Parentheses are used to define the scope and precedence of the operators (among other uses). For example, gray|grey and gr(a|e)y are equivalent patterns which both describe the set of " gray" and " grey".
Quantification
A quantifier after a token (such as a character) or group specifies how often that preceding element is allowed to occur. The most common quantifiers are ?, *, and +.
?The question mark indicates there is zero or one of the preceding element. For example, colou?r matches both "color" and "colour".
*The asterisk indicates there are zero or more of the preceding element. For example, ab*c matches "ac", "abc", "abbc", "abbbc", and so on.
+The plus sign indicates that there is one or more of the preceding element. For example, ab+c matches "abc", "abbc", "abbbc", and so on, but not "ac".

 不同的软件、语言的正则表达式语法不尽相同,打算专攻一下perl和java。

Reference:

 http://en.wikipedia.org/wiki/Regular_expression ( General concept)

 http://www.regular-expressions.info/ (Provide different languages format, very good!)

 http://www.regular-expressions.info/reference.html (Basic Syntax)

 http://docs.python.org/lib/re-syntax.html (in Python)

 http://www.regular-expressions.info/java.html (in Java)

 http://regexlib.com/ ( library for use) 

P:  blog的访问量也即将突破10万了,纪念一下

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值