diff options
author | Dimitris Kokkonis <kokkonisd@gmail.com> | 2020-10-10 12:31:09 +0200 |
---|---|---|
committer | Dimitris Kokkonis <kokkonisd@gmail.com> | 2020-10-10 12:31:09 +0200 |
commit | 916dceba25fcca6d7d9858d25c409bc9984c5fce (patch) | |
tree | fb9e604256d3c3267e0f55de39e0fa3b4b0b0728 /zh-tw/pcre-tw.html.markdown | |
parent | 922fc494bcce6cb53d80a5c2c9c039a480c82c1f (diff) | |
parent | 33cd1f57ef49f4ed0817e906b7579fcf33c253a1 (diff) |
Merge remote-tracking branch 'upstream/master' into master
Diffstat (limited to 'zh-tw/pcre-tw.html.markdown')
-rw-r--r-- | zh-tw/pcre-tw.html.markdown | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/zh-tw/pcre-tw.html.markdown b/zh-tw/pcre-tw.html.markdown index c9cdc537..5f681d46 100644 --- a/zh-tw/pcre-tw.html.markdown +++ b/zh-tw/pcre-tw.html.markdown @@ -13,7 +13,9 @@ lang: zh-tw 相容Perl正規表達式(Perl Compatible Regular Expressions, PCRE)是一個實作正規表達式的C語言函式庫。此函式庫在1997年被開發出來,在當時面對複雜字串處理時大多會選擇使用Perl。也因為如此,PCRE大多的正規表達式語法都很酷似Perl。PCRE語法被廣泛運用在許多大專案中,包括PHP、Apache、R等。 PCRE中的超字元(metacharacter)主要可以分為以下兩類: + * 在中括號外會被辨識的字元 + ``` \ 通用跳脫字元 ^ 字串開頭 或 行首 @@ -33,18 +35,17 @@ PCRE中的超字元(metacharacter)主要可以分為以下兩類: ``` * 在中括號內會被辨識的超字元,在中括號外會被視為字元集合使用 - + ``` - \ 通用跳脫字元 ^ 非字元集合的字,但只會抓到第一個符合的字元 - 字元範圍 [ POSIX字元集合(若後面接POSIX格式) ] 字元集合定義結束 - -``` +``` PCRE提供了一些通用的字元類型,可被當作字元集合使用 + ``` \d 任何數字字元 \D 任何非數字字元 |