Jedit: regex - how?

It has smth code:

<pre> text </pre> long long text <pre> text </pre> long long text 

I need to find this entry

 <pre> text </pre> 

in jedit and replace it with a space. (all the rules that I read here are http://www.jedit.org/users-guide/regexps.html ).

My expression:

 <pre>([\.\n]*?)</pre> 

But he could not find the record.

Which expression should be correct?

+4
source share
1 answer

In your regular expression . It is processed literally, and not as a metacharacter to match any character except a new line.

Try:

 <pre>(.|\n)*?</pre> 

Since no OS is specified, a new line can be represented either \n (Unixes) or \r\n (windows). In any case, you can use:

 <pre>(.|\r?\n)*?</pre> 
+2
source

Source: https://habr.com/ru/post/1385522/


All Articles