When I tried this, I got some padding, the string was " '128'", e.g. a space plus the single quotes. Was going to check if there's a way to strip that with the module, but it's your answer now. ;)
–
TLPJul 27 '11 at 13:19

This is a quote, followed by any number of non-quotes, then another quote, a comma, and some optional whitespace. All that is repeated four times with () around the fourth value to capture it. This may not work if the values are allowed to have quotes in them.

As Cameron pointed out, you can avoid the repetition using:

/(?:'[^']*',\s*){3}'([^']*)'/

The ?: tells the regexp parser not to capture the stuff inside the brackets.

Might be easier to split the list up using split with the comma as the delimiter, and then take the fourth element. Of course, if you can have commas inside the values, that may not work.

If he's guaranteed to have tic-comma-tic, that's a better delimiter to use than just the comma ... it fails to strip the beginning and end parenthesis for the first and last field, but makes the command pretty easy, unless I'm missing some requirements ;).
–
AndyMacJul 27 '11 at 13:10

1

This can be shortened to /(?:'[^']*',\s*){3}'([^']*)'/
–
CameronJul 27 '11 at 13:11