user20395
user20395

Reputation: 13

Regular expression to find string in middle

The raw string

<li><a href="/string/FIXED-123546">Value A
</a></li><li> <a href="/string/FIXED-265485">
Value B</a></li><li><a href="/string/FIXED-343">
Value C</a></li>

I wish to find the string:

123456ValueA

265485ValuB

343ValueC

If this is difficult, finding something like this will do "123546">Value A"

I'm new to regex and only manage to have this regex, of course it does't work fine: FIXED(.*)</a>

Anyone can help?

Edited:

I dont use any programming language here, i will use some kind of regex editor to extract the string for one time use.

Online regex tool i will use:

http://www.regexr.com/

http://regex101.com/

Upvotes: 1

Views: 1302

Answers (1)

Bohemian
Bohemian

Reputation: 425073

This regex matches your targets:

FIXED-(\d+)">([^<]*)

Join together groups 1 and 2

See live demo

Upvotes: 1

Related Questions