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 does DW implement a regular expression that finds all characters before a string

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces DW how to find all the characters in front of a string regular expression, the text is very detailed, has a certain reference value, interested friends must read!

When I use DW, the editor I have seen and obtained, to write html, I like to write comments, such as comments, etc. In a relatively large change, I need to find and replace in batches. In order to operate in batches, I wrote a regular expression to handle it.

Find:

(\r\n|\n|.)*?

The effect is as shown in the picture:

Another common one is the characters between strings.

For example: Find the characters between them, including newlines.

Find:

(\r\n|\n|.)*?

Effect as shown in the picture:

dw regular interpretation, for dw regular, there is no pattern modifier like php such as/i,/s

So the metacharacter (.) of dw does not match newline, can only use (\r\n|\n|.)*? to replace the modifier/s.

In DW\r\n(windows newline) and\n (unix newline) are newlines, plus arbitrary characters. We can match multiple lines.

The above is "DW how to find all the characters before a string of regular expressions" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to 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