Regular Expressions

  • Thread starter Thread starter Xarky
  • Start date Start date
X

Xarky

Hi,
I am trying to use Regex to help me do the following task.

I have the following string
data (\\unknown) \".\" \"hello world\"
and would like to extract the text between the last 2 quotes. In this
case the result should be the 'hello world' word.


Can someone help me out
Thanks in Advance
 
Use this regex : .*\"(.*)\"[^\"]*$

Here is a sample of use :
Regex regex=new Regex(".*\"(.*)\"[^\"]*$");
Match match=regex.Match(textBox1.Text);
if (match.Success) MessageBox.Show(match.Groups[1].Value);

Hope it helps,

Ludovic SOEUR.
 
Back
Top