I'm using the regex class to try and search a string for line feeds,
carriage returns, and tabs. In a windows test app, I can enter the
expression of \\[rnt] and this works fine. But in the ASP.net app, the same
expression does not work, even though the same process and test strings are
being used. Here's the set of code to test this process on the ASP.net page
that I'm using:
string strExpression = @"\\[rnt]";
System.Text.RegularExpressions.Regex objRegEx = new Regex(strExpression);
System.Text.RegularExpressions.Match objMatch = objRegEx.Match(strMsgBody);
Again, note that this works using the windows forms app. The only difference
is that the expression is input into a text box. Just for grins, I put a
text box on the ASP.net page and entered the expression there as well -
still no success.
Anybody have any thoughts on this?
Thanks in advance,
Dan 6 1688
Unless I'm missing something, your expression matches the literal backslash,
followed by one of the literals r, n, or t. I believe the expression should
read:
[\r\n\t]
Brian Davis http://www.knowdotnet.com
"Dan Hargrove zau.net>" <dhargrove@har<rmvMe> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl... I'm using the regex class to try and search a string for line feeds, carriage returns, and tabs. In a windows test app, I can enter the expression of \\[rnt] and this works fine. But in the ASP.net app, the
same expression does not work, even though the same process and test strings
are being used. Here's the set of code to test this process on the ASP.net
page that I'm using:
string strExpression = @"\\[rnt]"; System.Text.RegularExpressions.Regex objRegEx = new Regex(strExpression); System.Text.RegularExpressions.Match objMatch =
objRegEx.Match(strMsgBody); Again, note that this works using the windows forms app. The only
difference is that the expression is input into a text box. Just for grins, I put a text box on the ASP.net page and entered the expression there as well - still no success.
Anybody have any thoughts on this?
Thanks in advance, Dan
Unless I'm missing something, your expression matches the literal backslash,
followed by one of the literals r, n, or t. I believe the expression should
read:
[\r\n\t]
Brian Davis http://www.knowdotnet.com
"Dan Hargrove zau.net>" <dhargrove@har<rmvMe> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl... I'm using the regex class to try and search a string for line feeds, carriage returns, and tabs. In a windows test app, I can enter the expression of \\[rnt] and this works fine. But in the ASP.net app, the
same expression does not work, even though the same process and test strings
are being used. Here's the set of code to test this process on the ASP.net
page that I'm using:
string strExpression = @"\\[rnt]"; System.Text.RegularExpressions.Regex objRegEx = new Regex(strExpression); System.Text.RegularExpressions.Match objMatch =
objRegEx.Match(strMsgBody); Again, note that this works using the windows forms app. The only
difference is that the expression is input into a text box. Just for grins, I put a text box on the ASP.net page and entered the expression there as well - still no success.
Anybody have any thoughts on this?
Thanks in advance, Dan
BTW, if anyone is interested, there is an excellent freeware application for
woking with and testing Regular Expressions. You can download it from the
following URL: http://www.weitz.de/regex-coach/
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Brian Davis" <@> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl... Unless I'm missing something, your expression matches the literal
backslash, followed by one of the literals r, n, or t. I believe the expression
should read:
[\r\n\t]
Brian Davis http://www.knowdotnet.com "Dan Hargrove zau.net>" <dhargrove@har<rmvMe> wrote in message news:et**************@TK2MSFTNGP11.phx.gbl... I'm using the regex class to try and search a string for line feeds, carriage returns, and tabs. In a windows test app, I can enter the expression of \\[rnt] and this works fine. But in the ASP.net app, the same expression does not work, even though the same process and test strings are being used. Here's the set of code to test this process on the ASP.net page that I'm using:
string strExpression = @"\\[rnt]"; System.Text.RegularExpressions.Regex objRegEx = new
Regex(strExpression); System.Text.RegularExpressions.Match objMatch = objRegEx.Match(strMsgBody); Again, note that this works using the windows forms app. The only
difference is that the expression is input into a text box. Just for grins, I put a text box on the ASP.net page and entered the expression there as well - still no success.
Anybody have any thoughts on this?
Thanks in advance, Dan
BTW, if anyone is interested, there is an excellent freeware application for
woking with and testing Regular Expressions. You can download it from the
following URL: http://www.weitz.de/regex-coach/
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Brian Davis" <@> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl... Unless I'm missing something, your expression matches the literal
backslash, followed by one of the literals r, n, or t. I believe the expression
should read:
[\r\n\t]
Brian Davis http://www.knowdotnet.com "Dan Hargrove zau.net>" <dhargrove@har<rmvMe> wrote in message news:et**************@TK2MSFTNGP11.phx.gbl... I'm using the regex class to try and search a string for line feeds, carriage returns, and tabs. In a windows test app, I can enter the expression of \\[rnt] and this works fine. But in the ASP.net app, the same expression does not work, even though the same process and test strings are being used. Here's the set of code to test this process on the ASP.net page that I'm using:
string strExpression = @"\\[rnt]"; System.Text.RegularExpressions.Regex objRegEx = new
Regex(strExpression); System.Text.RegularExpressions.Match objMatch = objRegEx.Match(strMsgBody); Again, note that this works using the windows forms app. The only
difference is that the expression is input into a text box. Just for grins, I put a text box on the ASP.net page and entered the expression there as well - still no success.
Anybody have any thoughts on this?
Thanks in advance, Dan
Damn, that worked. Weird, but I didn't need to do that in the windows app I
was using. I'll have to look into that one just so I know wtf happened.
Thanks!
"Brian Davis" <@> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl... Unless I'm missing something, your expression matches the literal
backslash, followed by one of the literals r, n, or t. I believe the expression
should read:
[\r\n\t]
Brian Davis http://www.knowdotnet.com "Dan Hargrove zau.net>" <dhargrove@har<rmvMe> wrote in message news:et**************@TK2MSFTNGP11.phx.gbl... I'm using the regex class to try and search a string for line feeds, carriage returns, and tabs. In a windows test app, I can enter the expression of \\[rnt] and this works fine. But in the ASP.net app, the same expression does not work, even though the same process and test strings are being used. Here's the set of code to test this process on the ASP.net page that I'm using:
string strExpression = @"\\[rnt]"; System.Text.RegularExpressions.Regex objRegEx = new
Regex(strExpression); System.Text.RegularExpressions.Match objMatch = objRegEx.Match(strMsgBody); Again, note that this works using the windows forms app. The only
difference is that the expression is input into a text box. Just for grins, I put a text box on the ASP.net page and entered the expression there as well - still no success.
Anybody have any thoughts on this?
Thanks in advance, Dan
Damn, that worked. Weird, but I didn't need to do that in the windows app I
was using. I'll have to look into that one just so I know wtf happened.
Thanks!
"Brian Davis" <@> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl... Unless I'm missing something, your expression matches the literal
backslash, followed by one of the literals r, n, or t. I believe the expression
should read:
[\r\n\t]
Brian Davis http://www.knowdotnet.com "Dan Hargrove zau.net>" <dhargrove@har<rmvMe> wrote in message news:et**************@TK2MSFTNGP11.phx.gbl... I'm using the regex class to try and search a string for line feeds, carriage returns, and tabs. In a windows test app, I can enter the expression of \\[rnt] and this works fine. But in the ASP.net app, the same expression does not work, even though the same process and test strings are being used. Here's the set of code to test this process on the ASP.net page that I'm using:
string strExpression = @"\\[rnt]"; System.Text.RegularExpressions.Regex objRegEx = new
Regex(strExpression); System.Text.RegularExpressions.Match objMatch = objRegEx.Match(strMsgBody); Again, note that this works using the windows forms app. The only
difference is that the expression is input into a text box. Just for grins, I put a text box on the ASP.net page and entered the expression there as well - still no success.
Anybody have any thoughts on this?
Thanks in advance, Dan
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
7 posts
views
Thread by alphatan |
last post: by
|
3 posts
views
Thread by Dan Hargrove |
last post: by
|
3 posts
views
Thread by Dan Hargrove |
last post: by
|
8 posts
views
Thread by Bob |
last post: by
| | | | | | | | | | |