下一节课程: 正则表达式基础<2>(5744次播放)

5 秒后自动播放下一节
  重新观看
章节
笔记
提问
课件
反馈
捐赠

JavaScript极速入门_玉女心经系列

  • 推荐课程
  • 评论
  • 问答
  • 笔记
  • 课件下载
Lujia工作室

Lujia工作室

建议配字母,有时候说话根本听不清

1年前    添加回复 0

回复
A@美宅客@王星

A@美宅客@王星

课程内容很好 感谢分享

2年前    添加回复 0

回复
whatever

whatever

详细点就好了 .

2年前    添加回复 0

回复
YISE

YISE

不错的教程

2年前    添加回复 0

回复
MrSwan

MrSwan

快更新呀, 期待更多知识点

3年前    添加回复 0

回复
灭绝师太

灭绝师太

课程还在更新中……

3年前    添加回复 0

回复
水晶石

水晶石

就这么结束了?感觉好像只有百分之一的内容。不过,还是谢谢灭绝师太的讲解。

3年前    添加回复 0

回复
仲颖**

仲颖**

见PPT ^匹配字符串开头,一行的开头 $匹配字符串结尾,一行的结尾 .匹配除了换行符和终止符之外的任意字符 *匹配前一项的0次或多次 +匹配前一项的1次或多次 ?匹配前一项的0次或1次 =表示匹配 !表示不匹配 |两者之间进行选择 \转义符 /正则表达式内容包括在/内部 ()匹配子表达式的开始与结束的位置,内部放子表达式 []匹配一个字符类的开始 {}表示鉴定服务表达式的开始 测试: var str='hello php中文网' undefined var a=/^hello/ //查看hello是否为字符串开头 undefined a /^hello/ a.test(str) true var b=/^php/ //查看php是否为字符串开头 undefined b.test(str) false var c=/网$/ //网是否为字符串结尾 undefined c /网$/ c.test(str) true var d=/123|php/ //只要匹配到一个都是返回true undefined d.test(str) true //直接量字符,所有的字母和数字都是按照字面意思进行匹配,所有的字母和数字匹配到的字符都是自身, undefined var str1='hello \n php中文网' undefined var d=/\n/ undefined d.test(str1) true //字符类,将直接量字符单独放在[]内,就组成字符类 undefined var e=/[123p]/ undefined e.exec(str) ["p", index: 6, input: "hello php中文网", groups: undefined] var str1='hello\n php中文网' undefined var g=/\w/ undefined g.exec(str1) ["h", index: 0, input: "hello↵ php中文网", groups: undefined] /\W/.exec(str1) ["↵", index: 5, input: "hello↵ php中文网", groups: undefined] /^123hellophp/.exec(str1) null /[^123hellophp]/.exec(str1) ["↵", index: 5, input: "hello↵ php中文网", groups: undefined] var str1='我是hello\n php中文网' undefined /\b/.exec(str1) ["", index: 2, input: "我是hello↵ php中文网", groups: undefined] /\B/.exec(str1) ["", index: 0, input: "我是hello↵ php中文网", groups: undefined]

3年前 1

  • 课件下载JavaScript笔记所属章节:JavaScript极速入门_玉女心经系列
    下载