Match One of Many Characters (匹配多个字符中的一个)
2014-03-27 09:57
302 查看
1. 需求及方法
1) Calendar with misspellings
c[ae]l[ae]nd[ae]r
2) Hexadecimal character
[a-fA-F0-9]
3) Non-hexadecimal character
[^a-fA-F0-9]
2. 小结
1). Shorthand character
\d matches a single digit
\D matches any character that is not a digit
\w matches a single word character
\W matches a character that is not part of such a propellerhead word
\s matches any whitespace character (including spaces, tabs, line breaks)
\S matches any character not matched by <\s>
2). Case insensitivity
(?i)
eg. (?i)[A-F0-9]
1) Calendar with misspellings
c[ae]l[ae]nd[ae]r
2) Hexadecimal character
[a-fA-F0-9]
3) Non-hexadecimal character
[^a-fA-F0-9]
2. 小结
1). Shorthand character
\d matches a single digit
\D matches any character that is not a digit
\w matches a single word character
\W matches a character that is not part of such a propellerhead word
\s matches any whitespace character (including spaces, tabs, line breaks)
\S matches any character not matched by <\s>
2). Case insensitivity
(?i)
eg. (?i)[A-F0-9]
相关文章推荐
- Match One of Two Alternatives Based on a Condition (基于条件匹配多个选择中的一个)
- Match One of Several Alternatives (匹配多个选择中的一个)
- rangeOfString不必一个字符一个字符的匹配。
- 一个好用的字符过滤,差异匹配补丁的扩展库,各语言版本
- 向SQL2005导入Excel数据出现“文本被截断,或者一个或多个字符在目标代码页中没有匹配项”的错误0xc020901c
- perl模式匹配中用含特殊字符的变量?(using a variable as a pattern which contains special characters?)
- Linux_C练习:输入一个字符串,同时输入帧头和帧尾(可以是多个字符),将该字符串中合法的帧识别出来。提示:帧头和帧尾分别是head和tail 字符串”asdheadhauboisoktai
- 许留山导入到SQL “文本被截断,或者一个或多个字符在目标代码页中没有匹配项”错误的解决
- spring-data-jpa 中,如果使用了one-to-many , many-to-one的注释,会在Jackson进行json字符串化的时候出现错误
- 在多个字符串中寻找一个字符
- Group and Capture Parts of the Match (归类和抓取匹配中某部分)
- 将字符串s1中任何与字符串s2匹配的字符都删去,存放于一个新的字符串s3中
- excel数据导入sqlserver中时报文本被截断,或者一个或多个字符在目标代码页中没有匹配项
- (字符串的模式匹配4.7.18)POJ 1961 Period(求一个串到第i个字符循环节出现的次数)
- 实现一个比较高级的字符匹配算法,即一串很长的字符,要求找到符合要求字符的字符串
- why inverse must be setted in hibernate bidirectional association of one-to-many and many-to-many
- SQL Server: Text was truncated or one or more characters had no match in the target code page error
- 要验证这样一个字符串,其中不能包含多个字符
- Microsoft SQL Server 2008 R2 XML处理 One solution is to increase the number of characters retrieved from the server for XML data.
- Requst.QueryString[]取得的值是中文时,有时少了一个或者多个字符的问题