[][A-Z]|[A-Z]|[A-Z]|[A-Z]|[A-Z][]
What is a stock symbol Can you give an example of it....
if you are checking only for a series of 5 characters then [A-Z]{5}
or if you want 0 or more times then u can use [A-Z]*
or if you want 1 or more times then u can use [A-Z]+
Gunjan
Gunjan246 wrote:
What is a stock symbol Can you give an example of it....
if you are checking only for a series of 5 characters then [A-Z]{5}
or if you want 0 or more times then u can use [A-Z]*
or if you want 1 or more times then u can use [A-Z]+
Gunjan
1-5 characters then i will suggest [A-Z]{1,5}
Gunjan
Gunjan246 wrote:
1-5 characters then i will suggest [A-Z]{1,5}
Gunjan
Gunjan246 wrote:
string pattern = var + @"[A-Z]{1,5}";
your code wont give u the desired result as you told me earlier because your pattern string is incorrect
x|y |
Matches either x or y. For example, "z|food" matches "z" or "food". "(z|f)ood" matches "zood" or "food". |
Gunjan
Gunjan246 wrote:
your code wont give u the desired result as you told me earlier because your pattern string is incorrect
x|y
Matches either x or y. For example, "z|food" matches "z" or "food". "(z|f)ood" matches "zood" or "food".
Gunjan
In your code I would replace
string pattern = @"[/s][ext]|[A-Z]|[A-Z]|[A-Z]|[A-Z][/s]";
by
string var = "A";
string pattern = @"\s" + var + "[A-Z]{0,4}\s";
and replace
if (content.Contains(pattern))
{
MessageBox.Show("Success!");
}
else
{
MessageBox.Show("Failure!");
}
by
if (Regex.IsMatch(content, pattern, RegexOptions)
MessageBox.Show("Success!");
else
MessageBox.Show("Failure!");
string var = "A";
string pattern = @"\s" + var + "[A-Z]{0,4}\s";
WebRequest wr;
WebResponse wresponse;
StreamReader sr;
string content;
wr = HttpWebRequest.Create(urlstring);
wresponse = wr.GetResponse();
sr = new StreamReader(wresponse.GetResponseStream());
content = sr.ReadToEnd();
sr.Close();
if (Regex.IsMatch(content, pattern, RegexOptions.Multiline)
MessageBox.Show("Success!");
else
MessageBox.Show("Failure!");
I hope this post was helpful to you .... If yes please mark it as helpful