Regular Expression 使用规则

1、正则表达式通常被用来检索、替换那些符合某个模式(规则)的文本。

2、给定一个正则表达式和另一个字符串,可以达到如下目的:

(1)给定的字符串是否符合正则表达式的过滤逻辑(称作“匹配”);

(2)可以通过正则表达式,从字符串中获取我们想要的特定部分。

3、正则表达式"testing"中没有包含任何元字符,它可以匹配"testing"和"testing123"等字符串,但是不能匹配"Testing"。

4、正则表达式是区分大小写的,如果要忽略大小写可使用方括号表达式“[]”。只要匹配的字符出现在方括号内,即可表示匹配成功。但要注意:一个方括号只能匹配一个字符。例如,要匹配的字串tm不区分大小写,那么该表达式应该写作如下格式:[Tt][Mm].

用正则表达式写出查找姓名,电话,邮件的表达式
name:       var str = "My name is Linda";
                 var n = str.search(/Linda/i);

phone:      var str= "My phone is 15152180476";
                 var n =str .search(/15152180476/i);

email:        var str= "My email is 1964728520@qq.com";
                 var n =str .search(/1964728520@qq.com/i);

转载于:https://www.cnblogs.com/l69-l54/p/9846595.html

eighth week(2)相关推荐

  1. Electronic Principles Eighth Edition Edited by Albert Malvino and David Bates 电子原理书籍推荐

    Electronic Principles Eighth Edition Edited by Albert Malvino and David Bates 这本电子原理, 我认为可以看作是半导体的入门 ...

  2. 第一阶段冲刺 eighth day

    昨天学会了一些自定义控件的使用方法,还有ListView的一部分. 今天开始将之前学习的内容与本次将要编写的页面联系起来,进一步 完善页面. 设置了点击发布的一些条件. Button button1= ...

  3. Eighth season sixth episode,the Halloween party!!!!!!

    [Scene: Central Perk, everyone is there as Chandler and Monica enter. Oh, and Joey is wearing a FDNY ...

  4. Eighth C++基础之C++与C语言的区别及细节

    原文链接(点击原文链接获取更多学习干货): http://blog.bools.cn/archives/1335 C语言与C++ 在之前学习当中,我们知道C语言是面向过程的,而C++是面向对象的. C ...

  5. Eighth season eighteenth episode,the 35th wedding anniversary!!!!!!

    [Scene: Central Perk, everyone is there.] Phoebe: Oh, Ross, Mon, is it okay if I bring someone to yo ...

  6. Eighth season eleventh episode,Rachel became very horny??????

    [Scene: Central Perk, Rachel is looking around the shop as Phoebe returns from getting some more cof ...

  7. zigbee无线传感网实训---zigbee显示温湿度以及连接LCD开发板显示温湿度(The Eighth day)

    承接第七天:zigbee无线传感网实训---实现LCD开发板播放音乐并切换歌曲(The Seventh day) 一.实验准备器材如图:              二:步骤 ============= ...

  8. first season eighth episode,nana dies twice?Chandler is a gay???

    [Scene: Chandler's Office, Chandler is on a coffee break. Shelley enters.) Shelley: Hey gorgeous, ho ...

  9. Eighth season twenty-second episode,does sex promote childbirth???????

    [Scene: Central Perk, Joey is showing everyone a poster as Ross enters.] Ross: Hey! What are you guy ...

  10. Eighth season tenth episode,Monica got a very expensive boots????????

    [Scene: Monica and Chandler's, Monica is trying on a pair of new boots as Chandler enters.] Monica: ...

最新文章

  1. UA MATH566 统计理论5 假设检验简介
  2. easypoi教程_SpringBoot图文教程17—上手就会 RestTemplate 使用指南
  3. 科大星云诗社动态20210416
  4. java课程总结_java课程总结报告.doc
  5. 【JAVASCRIPT】表单序列化问题
  6. Unity HDRP渲染管线基础指南
  7. 基于css3的鼠标滑动按钮动画之CSS--续
  8. 阻塞队列,来写生产者消费者,生产一个消费一个
  9. python安装scrapy_Python安装Scrapy的种种
  10. 马哥linux第六周作业
  11. ZZULIOJ 1130: 杨辉三角
  12. GetWindowThreadProcessId
  13. django-演练-英雄的编辑
  14. WCF元数据交互及其序列化
  15. 在flex3中调用js函数
  16. mysql-multi source replication 配置
  17. 数据结构折半查找例题_查找-第9章-《数据结构题集》习题解析-严蔚敏吴伟民版...
  18. micropython源码分析之c模组注册
  19. 第十三届蓝桥杯省赛Java-B组
  20. 9.8.1 1.打印head标签的内容。2.打印body标签的内容。3.打印id为Hi的标签对象

热门文章

  1. 服务器 字体文件太大,网页的字体文件过大
  2. YY/T 0316风险管理对医疗器械得应用学习分享(一)
  3. colorbox ajax,Colorbox弹出层插件
  4. 宝宝专业智力测试软件,儿童医院心理科做智商检测-儿童智力测试仪_儿童注意力测试仪_儿童综合素质测试仪/测评系统...
  5. java实现断点续播_哪些播放器有断点续播和定点播放功能?
  6. php网页无法显示图片,XP系统中,网页图片无法显示怎么解决?
  7. 应用于arcgis的代码,长期更新…
  8. java调用opencc将中文简体繁体转换
  9. 二进制数转整数、整数转二进制数、二进制数求模
  10. 第二章 感受Mac 之美-惊艳从Mac 外设开始,一周后的使用感受