REGEX to extract word connected to nearest semicolon?

Posted by John Kaybern on Stack Overflow See other posts from Stack Overflow or by John Kaybern
Published on 2012-09-28T21:35:42Z Indexed on 2012/09/28 21:37 UTC
Read the original article Hit count: 232

Filed under:
|

I'm attempting to extract a series of data values from a text file.

The values are in the format: <MODIFIER NAME1 VALUE; MODIFIER NAME2 VALUE;>

For the purposes of the current task that I have, I only care about extracting the VALUE that is situated next to each semicolon. What would the REGEX command look like that would isolate each of these VALUES (preferably so that I backreference all values in the replacement part of my processing.) I believe that ^(.*?); is somehow used, but I'm not seeing how to isolate only the word that is attached to the semicolon in a group for backreference use.

Thanks!

© Stack Overflow or respective owner

Related posts about regex

Related posts about semicolon