Regex: HTML Scrub

I have a bunch of HTML code where I want to remove all HTML markup.

I think this is possible with Regex (regex). With search and replace, how would I do this?

I tried <*>, where I thought * was a wildcard, but apparently not. How do I make a regular expression find all <text>?

+4
source share
3 answers

A simple option:

<[^>]+> 

[] defines a character class, ^ excludes characters. Here is an example.

+14
source

Select "Regular Expression" in search mode. Enter [<].*?> In the Find field and leave the Replace field blank.

0
source

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


All Articles