Benimaru
(Benimaru)
April 3, 2024, 7:27am
1
Data stored in one variables:
2024-04-15(mon)
08
h
00
m
~ 2024-04-16(tue)
08
h
00
m
From the data stored in this way
2024-04-15, 08, 00, 2024-04-16, 08, 00
I want to extract only this data and store it in each variable, but I don’t know how to separate it.
ChinaMan
(ChinaMan)
April 3, 2024, 9:04am
2
ASCII char(13) + char(10),You can try it, this is the normal line break symbol “\ r \ n”
drag find matching pattern activity
use this regular expression \b\d{4}-\d{2}-\d{2}\b
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 9:31am
4
Using this you will only get “2024-04-15”
1 Like
Ajay_Mishra
(Ajay Mahendra Mishra)
April 3, 2024, 9:32am
5
Hey,
You can use this query:
System.Text.RegularExpressions.Regex.Matches(str_Input,“\b\d{4}-\d{2}-\d{2}\b|\d{2}”).Select(Function(x) x.ToString).ToArray
The output of the above query will give a Array of String.
Cheers!
Parvathy
(PS Parvathy)
April 3, 2024, 9:48am
6
Hi @Benimaru
inputString = "2024-04-15(mon)
08
h
00
m
~ 2024-04-16(tue)
08
h
00
m"
outputString = String.Join(", ", System.Text.RegularExpressions.Regex.Matches(inputString,"\d{4}-\d{2}-\d{2}|\d{2}"))
Hope it helps!!