-2

I'm not very handy with regex and I need to select everything outside <> to get the length of the string, excluding the "<>".

For example: first<second>third<fourth>fifth should give me first third fifth.

How can I do it? I spent some hours searching the web but I didn't really find what I needed. The regex is needed for use in javascript.

SophieV
  • 13
  • 1
  • 9

1 Answers1

0

You can always replace the text between smaller than and greater than symbols using regex below.

/<\w+>/g

In this case the text which is outside remains. See https://regexr.com/422jf

AlbertVanHalen
  • 632
  • 4
  • 12