Hi All,
please help to provide regex to find first word from sentence that contains number.
for ex : ZW Sep23 - ZC Dec23 Inter-Product
i want to find : Sep23
Thank you.
Hi All,
please help to provide regex to find first word from sentence that contains number.
for ex : ZW Sep23 - ZC Dec23 Inter-Product
i want to find : Sep23
Thank you.
syste.text.regularexpression.regex.match(your variable,“(?<=ZW).*(?=ZC)”).value.trim
in assign activity store the above in variable
Hi Usha,
The first word ‘ZW’ constantly changes
‘ZC’ also constantly changes, I only need the word with number
You can call them by index whichever value you want
only the first one, the second is not included
Hi,
How about the following expression?
System.Text.RegularExpressions.Regex.Match(strData,"\w*\d\w*").Value
Regards,
Hi Yoichi,
it can’t work if the word is double
[A-Za-z]+\d+(?=\s*\-)
Hi,
Did you check it in regex101? regex101 highlights all matched string.
Can you try the following expression? This returns only first match.
System.Text.RegularExpressions.Regex.Match(strData,"\w*\d\w*").Value
Regards,
Hi,
okok, thanks for the explanation.
Regards.
Hi,
FYI, in regex101, if turn off global option, the first match is highlighted as the following
Regards,
You can use the below one with regular expression.
- Assign -> Input = "ZW Sep23 - ZC Dec23 Inter-Product"
- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input.toString,“(\w+\d+)”).value
Check the below workflow for better understanding.
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.