Environment: Visual Studio 2008 SP1
How can I write the following regex?
I’m trying to get to ‘target string. The pattern is any string between [name]=’ ‘
/*Input String*/
SET [blah] = 'AE', [blah] = 'A1A', [number] = 004 WHERE [name]='target string'
/*Current Regex*/
(?<=[?name]?=).*(?=\')
/*Current Results*/
'AE', [blah] = 'A1A', [number] = 004 WHERE [name]='target string
/*Desired Results*/
'target string
Does this do it?
Or if the target string has to be returned without the leading (‘):
Note: I assume that the target string does not have escaped apostrophes (”).
EDIT: This does the trick with the escaped apostrophes:
It will find “
'John''s pub” in