Regular Expression - Posix
来源:互联网 发布:node 虚拟主机 编辑:程序博客网 时间:2024/06/05 23:16
1. Character Class
[:alnum:] // match number[:alpha:] // match char[:lower:] // match lower case char[:upper:] // match upper case char[:digit:] // match float[:xdigit:] // match 0x number[:punct:] // match punctuation[:blank:] // match tab and space key[:space:] //match blank char[:cntrl:] //match control key[:print:] //match all the char that can be printed[:graph:] //match all the printed char except the space key
1.1 Repeat (wish some strings can be repeated for multiple times)
* : repeat for 0 or more than 0 times+: repeat at least 1 timesex: [:alnum:]+ // indicate there is at least 1 character
1.2 Count subexpression
{num} // the number in the '{}' indicate how many time the content can be repeated.{3} repeat 3 times {2, 4} repeat 2 to 4 times
1.3 Locate at start or end point
^ : locate at the beginning of the String ex: ^There // the String must begin with There$: locate at the end of the String ex: cat$ // the String must end with cat
1.4 Branches (or)
| : indicate one of these choices ex: com | edu | net // match 'com' or 'edu' or 'net' for the email
2. Special character
2.1 the special char used outside the bracket ... [ ]
\ : escape character^: matching at the beginning of String$: matching at the end of String.(dot) : matching the char except '\n'| : branch (or)(....) : full match* : repeat more than 0 times , including 0+: repeat at least 1 times{ num } : count how many time the String can be repeated? : indicate one of the modular is optional
2.2 the special char used inside the bracket [...]
\ : escape character^: used at the beginning, indicate 'nor'- : indicate the 'range'
0 0
- Regular Expression - Posix
- regular expression
- Regular Expression
- regular expression
- Regular Expression
- Regular Expression
- regular expression
- Regular Expression
- Regular Expression
- regular expression
- Regular expression
- Regular Expression
- Regular Expression
- regular expression
- Regular expression
- regular expression
- regular expression
- Regular Expression
- 使用lrun
- mac 搭建 内网微信服务 ngrok
- mount.nfs: an incorrect mount option was specified
- Scala Everything is an object
- B-树小结汇总
- Regular Expression - Posix
- Linux使用笔记
- 欢迎使用CSDN-markdown编辑器
- POJ1258 Kruskal
- mysql sql语句大全
- 南邮编程在线编程题十二:八进制转换为二进制
- BestCoder Round #65 1002 ZYB's Game HDU5591
- Android网络请求
- js学习,变量提升(hositing)与作用域(Scoping)浅析