阅读背景:

如何忽略正则表达式主题字符串中的空格?

来源:互联网 

Is there a simple way to ignore the white space in a target string when searching for matches using a regular expression pattern? For example, if my search is for "cats", I would want "c ats" or "ca ts" to match. I can't strip out the whitespace beforehand because I need to find the begin and end index of the match (including any whitespace) in order to highlight that match and any whitespace needs to be there for formatting purposes. Is there a simple way to ignore the white space




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: