B
Big Daddy
I am new at regular expressions and can't get this to work quite right
for some reason. I want to check if a string matches the pattern
"asdf*.zip" where * is a wildcard and could be anything. But it
should start with "asdf" and end with ".zip" For example, this code
snippet shows what I mean:
Regex regex = new Regex(@"something");
bool b;
b = regex.IsMatch("asdf.zip"); // b would be true
b = regex.IsMatch("3asdf.zip"); // b would be false
b = regex.IsMatch("asdf.zip3"); // b would be false
b = regex.IsMatch("asdf!@#$%^&*().zip"); // b would be true
b = regex.IsMatch("asdfwwwwwwwww.zip"); // b would be true
In the first line of code, what would I replace "something" with in
order for the examples to work out?
thanks in advance,
John
for some reason. I want to check if a string matches the pattern
"asdf*.zip" where * is a wildcard and could be anything. But it
should start with "asdf" and end with ".zip" For example, this code
snippet shows what I mean:
Regex regex = new Regex(@"something");
bool b;
b = regex.IsMatch("asdf.zip"); // b would be true
b = regex.IsMatch("3asdf.zip"); // b would be false
b = regex.IsMatch("asdf.zip3"); // b would be false
b = regex.IsMatch("asdf!@#$%^&*().zip"); // b would be true
b = regex.IsMatch("asdfwwwwwwwww.zip"); // b would be true
In the first line of code, what would I replace "something" with in
order for the examples to work out?
thanks in advance,
John