G
Guest
I am creating some program which should get URL param from IE favorites
files. And I need create correct Regex for this.
Now I have this
string WorkString =
@"URL=http://www.test.com/homepage.asp?cool=rere%*&*#&(@&=sdfsdfsd%"
Regex URLrequest = new Regex(@"\s*URL\s*=\s*(?<URL>[\w\W]*)\s*",
RegexOptions.Compiled);
Match matcher = URLrequest.Match(WorkString);
if (matcher.Success)
{
string url = matcher.Result("${URL}");
}
And I have one problem with this
if the line string is "BASEURL=http://www.test.com/homepage...."
it works too.
But I need only make Regex return Success only when string is " URL="
and false when " BASEURL=http" or " XXS#URL = "
How I should modify Regex for this? How put negative condition at all?
files. And I need create correct Regex for this.
Now I have this
string WorkString =
@"URL=http://www.test.com/homepage.asp?cool=rere%*&*#&(@&=sdfsdfsd%"
Regex URLrequest = new Regex(@"\s*URL\s*=\s*(?<URL>[\w\W]*)\s*",
RegexOptions.Compiled);
Match matcher = URLrequest.Match(WorkString);
if (matcher.Success)
{
string url = matcher.Result("${URL}");
}
And I have one problem with this
if the line string is "BASEURL=http://www.test.com/homepage...."
it works too.
But I need only make Regex return Success only when string is " URL="
and false when " BASEURL=http" or " XXS#URL = "
How I should modify Regex for this? How put negative condition at all?