- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
兼有js与java的正则用法(Regular use of both JS and Java)
兼有js与java的正则用法(Regular use of both JS and Java)
Introduction to regular expressions in JAVA
First, what is regular expression?
Regular expressions are powerful tools that can be used for pattern matching and substitution. We can find regular expressions in almost all tools based on UNIX systems, such as VI editors, Perl or PHP scripting languages, and awk or sed shell programs. In addition, scripting languages such as JavaScript provide support for regular expressions.
Regular expressions allow users to validate patterns by using a series of special characters to construct matching patterns.
In addition, it can efficiently create, compare and modify strings, and quickly analyze a large number of text and data to search, remove, and replace text.
Such as:
Two, basic knowledge
1.1 start and end symbols (they also belong to locators)
Lets start with a simple start. Suppose you want to write a regular expression rules, you can use ^ and $symbol, they are the beginning of the match, end of line.
For example: /^\d+[0-9]? \d+$/?
1.2 dot symbol
Lets say youre playing an English spelling game, trying to find three letter words, and these words must begin with the t letter and end with the n letter. In addition, if you have an English dictionary, you can use regular expressions to search for all of it. To construct the regular expression, you can use a wildcard -- a symbol . In this way, the complete expression is T.N, which matches Tan, ten, tin and ton, and matches t#n, TPN, even t n, and many other meaningless combinations. This is because a symbol matching all the characters, including spaces, Tab or even a newline character:
1.3 square brackets sign
In order to solve a symbol matching range is too wide for this problem, you can be in square brackets ([]) inside the specified seems meaningful character. At this point, only characters specified in square brackets participate in the match. That is, the regular expression t[aeio]n matches only Tan, Ten, tin, and ton. But Too
您可能关注的文档
- 打造个人电脑安全终极防线(Build the ultimate defense line of personal computer security).doc
- 打造超级战斗力销售团队---有效解决销售人员自动玩命干的激励管理宝典(Create a super battle force - sales team effectively solve sales staff incentive management automatic hard dry collection).doc
- 打鼾儿童应及早治疗(Snoring children should be treated as soon as possible).doc
- 扩内需政策推进家电业管理完成苏醒(Expansion of domestic demand policy to promote the completion of the home appliance industry management).doc
- 扩大内需与调整消费政策(Expanding domestic demand and adjusting consumption policy).doc
- 承保管理(Underwriting management).doc
- 承台专项施工安全方案(Special construction safety program for platform).doc
- 承德避暑山庄导游词(Chengde Mountain Resort guide word).doc
- 承德露露(Chengde Lulu).doc
- ——近百种围巾的系法和搭配(- the method and collocation of nearly a hundred kinds of scarves).doc
- 关公真能战秦琼!电玩史上那些大乱斗游戏(Guan Gong really can fight Qin Qiong! Video game history of those chaos game).doc
- 关注日央行利率决议(Bank of Japan interest rate decision).doc
- 冒险岛DS简体中文版金手指(Adventure Island DS simplified Chinese version of gold finger).doc
- 冀教版二年级美术下册《画迷宫》教案(The second grade of jijiaoban art painting labyrinth lesson 2).doc
- 决定你一生成功的21条信念-易发久(Decision 21 convictions - you prone to long success in life).doc
- 冲突理论视角下的体育越轨行为(Sports deviance from the perspective of conflict theory).doc
- 决策主要分类方法介绍(Introduction to major classification methods for decision making).doc
- 冷水机的十种分类方式以及六种主流冷水机优缺点(Ten classifications of chiller and the merits and demerits of six main water chillers).doc
- 冬吴相对论第328讲——讲究的能力(Winter Wu theory of relativity, 328th stresses on ability).doc
- 冷战缔造互联网(The cold war created the Internet).doc
文档评论(0)