How to extract numbers after every static word

For eg I have input FROM GET FULL TEXT
AFD7,876SIGNCOPY675MPD9,877SVC7,765APE20,789
in this section names are AFD,SIGN COPY,MPD,SVC,APE
I need to extract number counts after these names
Please guide anyone?

image

system.text.regularexpression.regex.maches(variable,“[0-9,]+”).count

Hi @vnsatyasunil ,
string b= System.Text.RegularExpressions.Regex.Replace(“string_Variable”,“\D”,“”)
regards,
LNV

@vnsatyasunil
Array_str=Str.Split(“,“c)
For each
InputString=System.Text.RegularExpressions.Regex.Match(currentItem,”[A-Z]+”).Value
Assign:InputString.Length--------------->This will give the length

can you please look into this

Hi @vnsatyasunil

\d+

getting count but not getting counts i.e numbers

@vnsatyasunil

Try this

\d+\,?\d+

Is this the expression?
system.text.regular expressions.regex.matches(variablename,“(\d+,?\d+)”.tostring

@vnsatyasunil

Extracting numbers from the input text

Hi @vnsatyasunil

Assign the syntax to matchCollection variable

Use matchcollectionvaraible(index).length gives you the length of each

@vnsatyasunil

image

Assign activity:
input=AFD7,876SIGNCOPY675MPD9,877SVC7,765APE20,789

Take again Assign activity
output=system.text.Regular Expressions.Regex.Matches(input,“(?<=[A_Z])[0-9.,]+”).value

Hi @vnsatyasunil

You can use the below regular expression to extract the required output

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=\w+)[\d,]+)”)

image

Hope it helps!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.