2

I am trying to get through a lot of content and to extract some data from it. Therefore I need to pick the information between 2 set of characters.

It looks like this

***some text*** li> ***data to capture*** </li ***more text***

What regex can I use to get everything that is enclosed between li> and </li ?

Spearfisher
  • 7,879
  • 18
  • 64
  • 119

1 Answers1

1

Basically it will be like this:

li>(.*?)(?:</li)

Depending on your language environment, certain characters may need to be escaped or the way of retrieving the matched string may differ. Typically you would need to escape / by prepending a backslash, resulting in this new version:

li>(.*?)(?:<\/li)

Here's a live demo: https://regex101.com/r/zV4uN6/1

Eirik Birkeland
  • 577
  • 5
  • 11
hata
  • 10,652
  • 6
  • 37
  • 62