0

I have registry values that appear in the HTML document. I try to mark every registry entry that appears in the example. The problem is where the <br> character

https://regex101.com/r/BgNjh6/5

Image example

bugnet17
  • 163
  • 1
  • 1
  • 10
  • 1
    [Obligatory suggestion to not use regex on HTML](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags) – VLAZ Feb 07 '19 at 08:58

2 Answers2

1

Maybe try using a lookahead:

HKEY_\S+(?=<\/)

Example:

https://regex101.com/r/BgNjh6/3

l'L'l
  • 42,597
  • 8
  • 87
  • 135
  • Thanks. I also have a problem with the tag. please take a look: https://regex101.com/r/BgNjh6/5 – bugnet17 Feb 07 '19 at 09:03
  • For that you'll probably want something such as [`HKEY_\S+?(?=)`](https://regex101.com/r/BgNjh6/6) – l'L'l Feb 07 '19 at 09:28
0

Tested. Should Work

/HKEY_\S+(?=<\/)/g

?=< is called Positive Lookahead Assertion. It matches everything before itself unless you provide boundary.

Dhruvil21_04
  • 1,321
  • 2
  • 15
  • 29