Regex to find substring between two strings -


i'd capture value of initial catalog in string:

"blah blah initial catalog = mycat'"

i'd result be: mycat

there or not spaces before , after equal sign , there or not spaces before single quote.

tried , various others no go:

/initial catalog\s?=\s?.*\s?\'/ 

using .net.

this nice regex

= *(.*?) *' 

use idea , add \s , more literal text needed.

in c# group 1 contain match

string resultstring = null; try {     regex regexobj = new regex("= *(.*?) *'");     resultstring = regexobj.match(subjectstring).groups[1].value; } catch (argumentexception ex) {     // syntax error in regular expression } 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -