I have data like this
1938-13545 - Wofsy - RM
256560 / 13933
Expert Witness ck beck an
28400/4692
Here i need to extract Digits only but i want like this 1938,13545 separately and remove other characters(in place of - we may also get any special characters based on that character i want to separate the data)
Looking at your pattern, btw what will be your input? you can apply a for each loop on your content and string contains / then split according to it or else split by - this will give you array you can then access array items by indexes like array(0), array(1) and so on
Each time iām taking 1 string. If string contains only text then output is empty or it contains 1938-13545 - Wofsy - RM then the output is 1938 and 13545 separately. Thanks @PrankurJoshi
This is very basic example you would have to optimize by string operations or matches it according to requirement. Let me know if this works. And if you want only number not text
My exact requirement is i need to print the text before special character and after special character up to space.if the string doesnāt contains any number we need to print empty.
Then I guess you can use what @adarshk has suggested if you want other data as well from the string you will have to perform more string operation like I mentioned
Try using regex options to extract only numbers rather than trying substring as the length is not fixed.ā/dā in regex should be able to give you all the digits present in the complete string
i have tried to get the specific number from a string which is stored in a variable.
for an example
stringtext(variable) = my 1st professional id is 7654367 for the company
from the above example i need to extract only that 7 digit number.
i have tried System.Text.RegularExpressions.Regex.Replace(demotest,ā\Dā,āā)
but it returns the result including the number 1 from the second word of the string.
You were almost there, hereās a correction to your regex. Instead of removing the other non-digits in a string, you can directly select the first match of 7 consecutive digits, like this:
I want to extract a match of 10 digits using this method, though I can not assign that expression to my variable, I type ā.ā after my variable in the value section of the assign activity, nothing like this shows up. I tried to look for a package that contains that code but I do not make it to install System.Text.RegularExpressions.Regex class, Package installation failure shows in red in the packages section.