Emily_Yip
(Emily Yip)
1
I use ismatch activity to check whether string is same as my pattern and it returns boolean type of true or false.
But for match activity, what is the usage of match activity?
I want to extract some string in my pattern. Can I use match activity to help me for that?
2 Likes
AshwinS2
(Ashwin S)
2
Hi @Emily_Yip
Yes you can use match activity to check whether the regex pattern matches based on the string
Thanks
Ashwin.S
1 Like
Manish540
(Manish Shettigar)
3
You can use matches activity for that and you can practice your regex in below site,
1 Like
Yoichi
(Yoichi)
4
Hi,
Matches activity returns list of matched value.
For example, we can get value if there is some number which we don’t know its value in advance, like the following.
Input: “Amount: 1000 \r\n Tax 10\r\n”
Pattern: “\d+”
The result will be {“1000”,“10”} as IEnumerabel<Match>
type
Regards,
1 Like
Emily_Yip
(Emily Yip)
6
Thanks for all.
And I have a pattern like “You can get #00011200 xx; #00121300 xxxx”
I use ismatch to check if there is any “#(any 8 digits),(a space), (;)”.
I also want to extract string for the 8 digit and xx value.
How can I solve it?
Yoichi
(Yoichi)
8
Hi,
Can you try the following settings?
Pattern : "(?<=#)\d{8}\s\w+(?=;)"
Matches activity returns list of matched value.
If you want to get value directly, the following helps you.
strResult = System.Text.RegularExpressions.Regex.Match(strData,"(?<=#)\d{8}\s\w+(?=;)").Value
(Use Assign Activity)
Regards,
Manish540
(Manish Shettigar)
9
Use below regex in matches activity,
“(?<=#)\d*\s*\w*”
You will get two groups of match,
1.“00011200 xx”
2.“00121300 xxxx”
what is the use of # in the code you provided