I have to count the no of (0% loss) with brackets from a string. I got the solution by using Regex and match count. I am using below expressions:
System.Text.RegularExpressions.Regex.Matches(str_out1,“(0% loss)”).count - It is giving the right count that is ok. But when I am testing by changing “(20% loss)” in the string.It is also giving the same count.
I want to find the exact match count for “(0% loss)”. Someone please help me in this to form correct regular expression for exact match.
It will split the string by your keyword
So you will get it in an array
Ex
I am a boy.
If we split by " "
Then we will get array of I,am,a,boy
I.e. length of that array will be 4 and that means our word (here " " ) is comes 3times