当前位置:网站首页>JS正则匹配先行断言和后行断言
JS正则匹配先行断言和后行断言
2022-04-23 05:57:00 【zjLOVEcyj】
// 只匹配出现在y后面的x 紧跟着y后面的x
console.log(/(?<=y)x/.exec('acyx'));
// 只匹配不是出现在y后面的x
console.log(/(?<!y)x/.exec('asax'))
// 只匹配出现在y前面的x
console.log(/x(?=y)/.exec('xyqqa'));
// 只匹配不是出现在y前面的x
console.log(/x(?!y)/.exec('zsxsary'));
版权声明
本文为[zjLOVEcyj]所创,转载请带上原文链接,感谢
https://blog.csdn.net/cyj5201314/article/details/124277931
边栏推荐
- useCenterHook
- uniapp 自定义搜索框适配小程序对齐胶囊
- .Net Core 下使用 Quartz —— 【5】作业和触发器之触发器的通用属性和优先级
- Special register C51 / C52
- Analysis and setting of dead time
- Promise(四)
- .Net Core 下使用 Quartz —— 【2】作业和触发器之初步了解作业
- 查漏补缺(六)
- 服务器常见错误代码 总结
- The difference between single quotation mark, double quotation mark and back quotation mark in shell script
猜你喜欢
随机推荐
【ES6】 Promise相关(事件循环,宏/微任务,promise,await/await)
ASP.NET CORE3.1 Identity注册用户后登录失败的解决方案
百度地图案例-缩放组件、地图比例组件
【ORACLE与mysql的区别】
Use of shell scripts & and 𞓜
微信小程序之 js 时间戳/1000 转换 秒,六个小时后,一天后,本周五 选项计算时间
input文件上传
1-2 NodeJS的特点
Palindromic Primes
【正河源刀具相关】
el-table添加序号
VHDL finite state machine (FSM) code example
Wildcards and special symbols for shell scripts
Router对象、Route对象、声明式导航、编程式导航
Your brain expands and shrinks over time — these charts show how
Set与Map
Node data flow
Principle and characteristic analysis of triode
.NET Standard详解
ASP.NET CORE 依赖注入服务生命周期









