jntrk
(jntrk)
1
Hey everyone,
I have a text as:
" \r\nTemp-No;: 1234567\r\n03.01.2021\r\n123456\r\nThanks "
from this text I need to get 3 variables which are:
1234567 as number variable
03.01.2021 as date variable
123456 as ticketno variable
I believe there should be 3 different expression for each variable.
Any help?
1 Like
Hello @jntrk,
to extract 03.01.2021: \d{1,2}.\d{1,2}.\d{4}
to extract 123456 : \d+
dimibot
(Dimitrios)
3
You can extract all information with one regex.
And then access every value,by calling a different group e.g. 1,2,3
jntrk
(jntrk)
4
I get empty string. I did like this.
assigned val= System.Text.RegularExpressions.RegEx.Match(texttt, “(\d{7})\r\n(\d{1,2}.\d{1,2}.\d{4})\r\n(\d{6})”).Value
when I execute it I get empty string “”
dimibot
(Dimitrios)
5
You need to specify the group (enclosed by parenthesis in the regex patern).
For the first value: System.Text.RegularExpressions.RegEx.Match(texttt, “(\d{7})\r\n(\d{1,2}.\d{1,2}.\d{4})\r\n(\d{6})”).Groups(1).Tostring
For the second value: System.Text.RegularExpressions.RegEx.Match(texttt, “(\d{7})\r\n(\d{1,2}.\d{1,2}.\d{4})\r\n(\d{6})”).Groups(2).Tostring
etc.
1 Like
Aleem_Khan
(Aleem Anwer)
7
i try it but its return empty value could you please example of workflow
dimibot
(Dimitrios)
8
can you tells us what is the input string you are using and which information you want to extract?
system
(system)
Closed
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.