In my Google Sheet, I'm trying to delete the contents within any < >
symbols, including the '<'
'>'` symbols themselves.
For this example text: <h3>AJ Sports</h3> has been in business for 30 years
I want: 'AJ Sports has been in business for 30 years'
I've been using this regex formula =REGEXREPLACE(B2,"\s\<.*|\s\[.*","")
but it also deletes everything after the last '>'
.
With this regex, the output is: 'AJ Sports'
What do I need to add to only delete the desired portion and not the rest of the following text?
If you use this pattern:
\<[^>]*\>
it will see any open bracket <
, and match with the closest closing bracket >
, including the contents. More specifically, it will match with any string that contains an opening bracket, and a matching closing bracket .
RegexR showcase , explaining, and showing an example.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.