Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize positive and negative pre-check in regular expression

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to realize positive and negative pre-check in regular expression, which is very detailed and has certain reference value. Friends who are interested must finish reading it!

Let's first look at an example, and then explain what forward pre-checking is.

Example: there is a paragraph that reads "coming soon,going gogogo" and requires that com and go be found. The code is as follows:

/ / forward precheck function T1 () {var con = document.getElementsByName ('content') [0] .value; var reg = /\ b [\ w] + (? = ing\ b) / ing / match words with ing, but do not ing. Note: if you do not add\ b after ing, similar to goingabc will also match. Alert (con.match (reg));} regular preview above is all the content of the article "how to achieve positive and negative pre-checking in regular expressions". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report