0

I am trying to extract the info from the paragraph.

I want to get everything between the first (State:) and the (<br>).

Please see the link below. http://regexr.com/4uphu

This is the case:

<b>Bank:</b> <a href="#">ABU DHABI COMMERCIAL BANK</a><br><br><b>Address:</b>

If possible I need to extract this ABU DHABI COMMERCIAL BANK.

Thanks.

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
  • 1
    I don't see a `State:` in the text you are extracting from. And in your regexr example that string doesn't occur after a `State:` string. – Nick Feb 21 '20 at 01:35

1 Answers1

0

You can try to match the text between the anchor tags.

<a[^>]+>([^<]+)<\/a>

If you only want to match after "Bank:" then use the below:

<b>Bank:<\/b>\s<a[^>]+>([^<]+)<\/a>
Vlam
  • 1,622
  • 1
  • 8
  • 17