关于Regular Expression中文命名的思考

Regular Expression,通常被译为“正则表达式”,何为“正则”?

看看WIKI的定义:

https://en.wikipedia.org/wiki/Regular_expression
A sequence of characters that define a search pattern, usually such patterns are used by string searching algorithms for “find” or “find and replace” operations on string or for input validation
The phrase regular expressions, and consequently, regexes, is often used to mean the specific, standard textual syntax (distinct from the mathematical notation described below) for representing patterns for matching text.
Each character in a regular expression (that is, each character in the string describing its pattern) is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

从上面的文字可以看出,Regular Expression实际就是定义了一种“模式”,该模式用于搜索字符串。这个“模式”由字符集组成,其中的每一个字符,要么是“”有特殊含义的“元”字符(metacharacter),要么是有字面意义的常规字符(regular character that has a literal meaning)。
因此,学习和理解Regular Expression,首先必须抛弃“正则”这个概念,将其理解为“规范化表达式”更好一些,更容易理解。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

steventian72

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值