Hi Guys,
100/200/20/11982 (19 items)
I want to take out numeric value between braces from the above mentioned string.
Please guide me on this.
Thanks in advance
Hi Guys,
100/200/20/11982 (19 items)
I want to take out numeric value between braces from the above mentioned string.
Please guide me on this.
Thanks in advance
@Rahul_Jawahirani - Please try this pattern…
Output = Regexvar(0).groups(1).tostring
Hope this helps…
Another way would be
System.Text.RegularExpressions.Regex.Match(varStr,"(?<=[(])(\d|.){1,4}").Value
Hi,
you can try:
output = System.Text.RegularExpressions.Regex.Match(your_String, "(?<=\()\d{1,}").Value
output = String
your_String= String
Or:
output = System.Text.RegularExpressions.Regex.Match(your_String, "(?<=\()\d{1,}(?=\s+items\))").Value
output = String
your_String= String
It worked…
Thanks alot@Adrian_Star
CInt(“100/200/20/11982 (19 items)”.Split(“(”)(1).Split(" ")(0))
Splits on the ( and takes the second part of the split then splits again on the space and takes what’s before the space. Converts the resulting value to integer.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.