Preserved Topic: Regex to extract string |
|
---|---|
Author | Thread |
Maniac (V) Inmate From: Cell 666 |
posted 01-23-2004 03:33
I'm looking for a regular expression that will extract string literals (for use with egrep). That is, any number of characters between two double quotes, and on the same line. Escaped double quotes are allowed to be part of the string. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-23-2004 11:58
hm... I don't know egrep. |
Maniac (V) Mad Scientist From: :morF |
posted 01-23-2004 13:51
you know 'nax...that original regex of your should work if you put ( and ) around the first * |
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 01-23-2004 15:28
The reason you're getting the syntax error near unexpected token `(' is that you should have ' around the regexp, not ". code: egrep '"([^\\"]*)"' <path>
|
Maniac (V) Inmate From: Cell 666 |
posted 01-23-2004 15:33 |