RegEx.....
-
Hiii All.. i am using Regex to remove \r from the string. so using \\r for this. it removing \r, but also removing r from string. Not want 2 remove r, just \r need to be removed. so, plz tell me where i am wrong. Or what else can be done. thx in Adv. Enjoy! Sidh
-
Hiii All.. i am using Regex to remove \r from the string. so using \\r for this. it removing \r, but also removing r from string. Not want 2 remove r, just \r need to be removed. so, plz tell me where i am wrong. Or what else can be done. thx in Adv. Enjoy! Sidh
Member 3824736 wrote:
so, plz tell me where i am wrong.
My mental powers are a bit weak today, so I can't see your code clearly enough. Can you just post the code here? It will be easer to read that way.
Experience is the sum of all the mistakes you have done.
-
Member 3824736 wrote:
so, plz tell me where i am wrong.
My mental powers are a bit weak today, so I can't see your code clearly enough. Can you just post the code here? It will be easer to read that way.
Experience is the sum of all the mistakes you have done.
Hiii Guffa thx..... its............ i am using Regex to remove \r from the string. so using \\r for this. it removing \r, but also removing r from string. Not want 2 remove r, just \r need to be removed. so, plz tell me where i am wrong. Or what else can be done. thx in Adv. Enjoy! Sidh
-
Hiii Guffa thx..... its............ i am using Regex to remove \r from the string. so using \\r for this. it removing \r, but also removing r from string. Not want 2 remove r, just \r need to be removed. so, plz tell me where i am wrong. Or what else can be done. thx in Adv. Enjoy! Sidh
I can tell you where you are wrong. The code that you have written is wrong. What you describe is correct, but the code that you have written obviously doesn't do what you describe. If you want someone to help you with your faulty code, you have to post it.
Experience is the sum of all the mistakes you have done.
-
I can tell you where you are wrong. The code that you have written is wrong. What you describe is correct, but the code that you have written obviously doesn't do what you describe. If you want someone to help you with your faulty code, you have to post it.
Experience is the sum of all the mistakes you have done.
string sPattern = @"[^\p{Cc}\\r\\n\\a\\e\\b\\t][\S]*[\w\p{Po}\s-`\p{Sm}]*[^\p{Cc}\\r\\n\\a\\e\\b\\t]"; try { if (Regex.IsMatch(txtText.Text, sPattern, RegexOptions.Multiline | RegexOptions.IgnoreCase)) { objMatch = Regex.Match(txtText.Text, sPattern, RegexOptions.ECMAScript | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase); if (objMatch.Success) lblDone.Text = objMatch.Value; }//end (if (Regex.IsMatch...) }//end(try) finally { sPattern = null; }//end (finally) input string is :-- \r\nloadplayer "playername=test_1"\r\n output string should be :-- loadplayer "playername=test_1" want to neglect all newline,tabs.. etc from the input string. Now its doing fine, but also removing "r,n,a,e,b,t" from the starting of the input string. Means, if the input string is:-- roadplayer "playername=test_1"\r\n output becomes:-- oadplayer "playername=test_1" it should be:-- roadplayer "playername=test_1" so, tell me what i should do for better working. Thxx... Enjoy!!
-
string sPattern = @"[^\p{Cc}\\r\\n\\a\\e\\b\\t][\S]*[\w\p{Po}\s-`\p{Sm}]*[^\p{Cc}\\r\\n\\a\\e\\b\\t]"; try { if (Regex.IsMatch(txtText.Text, sPattern, RegexOptions.Multiline | RegexOptions.IgnoreCase)) { objMatch = Regex.Match(txtText.Text, sPattern, RegexOptions.ECMAScript | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase); if (objMatch.Success) lblDone.Text = objMatch.Value; }//end (if (Regex.IsMatch...) }//end(try) finally { sPattern = null; }//end (finally) input string is :-- \r\nloadplayer "playername=test_1"\r\n output string should be :-- loadplayer "playername=test_1" want to neglect all newline,tabs.. etc from the input string. Now its doing fine, but also removing "r,n,a,e,b,t" from the starting of the input string. Means, if the input string is:-- roadplayer "playername=test_1"\r\n output becomes:-- oadplayer "playername=test_1" it should be:-- roadplayer "playername=test_1" so, tell me what i should do for better working. Thxx... Enjoy!!
Answered in your other (latest) post. Latest Post[^]
Matthew Butler
-
string sPattern = @"[^\p{Cc}\\r\\n\\a\\e\\b\\t][\S]*[\w\p{Po}\s-`\p{Sm}]*[^\p{Cc}\\r\\n\\a\\e\\b\\t]"; try { if (Regex.IsMatch(txtText.Text, sPattern, RegexOptions.Multiline | RegexOptions.IgnoreCase)) { objMatch = Regex.Match(txtText.Text, sPattern, RegexOptions.ECMAScript | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase); if (objMatch.Success) lblDone.Text = objMatch.Value; }//end (if (Regex.IsMatch...) }//end(try) finally { sPattern = null; }//end (finally) input string is :-- \r\nloadplayer "playername=test_1"\r\n output string should be :-- loadplayer "playername=test_1" want to neglect all newline,tabs.. etc from the input string. Now its doing fine, but also removing "r,n,a,e,b,t" from the starting of the input string. Means, if the input string is:-- roadplayer "playername=test_1"\r\n output becomes:-- oadplayer "playername=test_1" it should be:-- roadplayer "playername=test_1" so, tell me what i should do for better working. Thxx... Enjoy!!