1 / 1
文档名称:

regular-expressions-cheat-sheet-v2.pdf

格式:pdf   页数:1
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

regular-expressions-cheat-sheet-v2.pdf

上传人:bolee65 2013/12/10 文件大小:0 KB

下载得到文件列表

regular-expressions-cheat-sheet-v2.pdf

文档介绍

文档介绍:Anchors Sample Patterns
^ Start of line + ([A-Za-z0-9-]+) Letters, numbers and hyphens
\A Start of string + (\d{1,2}\/\d{1,2}\/\d{4}) Date (. 21/3/2006)
$ End of line + ([^\s]+(?=\.(jpg|gif|png))\.\2) jpg, gif or png image
\Z End of string + (^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$) Any number from 1 to 50 inclusive
\b Word boundary + (#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?) Valid hexadecimal colour code
\B Not word boundary + ((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}) 8 to 15 character string with at least one
\< Start of word upper case letter, one lower case letter,
\> End of word and one digit (useful for passwords).
(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6}) Email addresses
(\<(/?[^\>]+)\>) HTML Tags
Character Classes
\c Control character These patterns are intended for reference purposes and have not been extensively tested.
Note
\s White space Please use with caution and test thoroughly before use.
\S Not white space
\d Digit
Quantifiers Ranges
\D Not digit
\w Word * 0 or more + . Any character except
\W Not word *? 0 or more, ungreedy + new line (\n) +
\xhh Hexadecimal character hh + 1 or more + (a|b) a or b +
\Oxxx Octal character xxx +? 1 or more, ungreedy + (...) Group +
? 0 or 1 + (?:...) Passive Group +
?? 0 or 1, ungreedy + [abc] Range (a or b or c) +
POSIX Character Classes
{3} Exactly 3 + [^abc] Not a or b or c +
[:upper:] U