Dear All,
How to write a regular expression to check % within [ and ]
Thanks,
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 27, 2011, 1:55 PM
string regExp = @"\[[^]]*%.*?]";
Pravin MorePosted Sep 27, 2011, 8:47 AM
try like this..............
Regex regex = new Regex(@"[(?%:32|10|13)]");
Match m=regex.Match("%");
MessageBox.Show(m.ToString());
Thanx,Hope it will help you.
Pravin.
Rakesh JhaPosted Sep 27, 2011, 8:38 AM
/(\[\w*?\d*?[%]\w*?\d*?\])/gi
you can put any thing according to your requirement in place of (\d & \w).