


Here is a simplified minimal example of input and desired output.

How can I improve my code to find all the occurrences? This successfully works for the last occurrence of foo within the JSON, but does not find the rest of the occurrences. I tried using the Notepad++ regex Replace functionality with this find expression: The result will be only JSON sections that contain foo. I want to improve my workflow, so instead of just finding all such JSON sections, I want to write a regex to remove all the HTML & JSON that does not match this expression. To do so, select the Regular expression option in the Search mode area. This works as expected in all the input that is possible. In Notepad++, you can use regular expressions in the Find and Replace dialog box. Install Python Script plugin from the Plugin Manager or from the official website. So the only way of accomplishing your task in Notepad++ is with the use of the Python Script plugin. Unfortunately there's no way to perform calculations in the replacement pattern. I've written the following regex to accomplish this task: That's not possible with the sole use of regular expressions in Notepad++.

Note that the JSON just happens to be embedded within a limited set of HTML source code which is loaded into Notepad++. These are in PCRE syntax.Using regular expressions (in Notepad++), I want to find all JSON sections that contain the string foo. I wrote my URL (actually IRI, internationalized) pattern to comply with RFC 3987 ( ). There is a post with my exact question, but in PHP rather than Notepad++. I have found several posts on negated expressions, but can't get them to work on a negated HTML tag in the capture group. I have tried using the entire tag close with non-greedy syntax and counting syntax using examples I found in other posts, but I can't get it to work. I cannot use (.*) because there may be two such on a line. What I think I need is something like this: The output of the above example would be: `See Problems pane for more information.` The desired result is the inner text of the elements without the span tags. Using Notepad++, a department of technical writers needs to remove the xxx tags from texts like this: `See Problems pane for more information.`
