Hello,
I have the following expression
“DK call: AB.1227.12
Notice call:”
I need to extract: AB.1227.12 and I tried all the Regex expression I know, but none of them worked. Do you have any idea how can I always extract what is between “DK call:” and “Notice call” because I have a large pdf document and this expression will repeat all the time and I need to store those values.
Thanks in advance!
TRY THIS
this works if you have same pattern
Hope this helps
ppr
(Peter Preuss)
October 26, 2023, 10:28am
3
strText = your Text
strPattern = (?<=DK call:).*
strValue = System.Text.RegularExpressions.Regex.Match(strText, strPattern).Value.Trim()
if both the words are constant you can try this
Parvathy
(PS Parvathy)
October 26, 2023, 10:30am
5
Hi @darie.leolea
Input= "DK call: AB.1227.12
Notice call:"
Output= System.Text.RegularExpressions.Regex.Match(Input,"(?<=DK\scall:\s).+").Value
Hope it helps!!
ppr
(Peter Preuss)
October 26, 2023, 10:30am
6
When the text which is to extract over multiple lines we would do:
You can try this way if both the “DK call: and Notice call:” are constant
STRINPUT : - “DK call: AB.1227.12
Notice call:”
STRINPUT.Split({"DK call:"},StringSplitOptions.RemoveEmptyEntries)(0).Split({"Notice call:"},StringSplitOptions.RemoveEmptyEntries)(0).Trim
output : -
@darie.leolea
1 Like
lrtetala
(Lakshman Reddy)
October 26, 2023, 10:36am
8
Hi @darie.leolea
Try this
System.Text.RegularExpressions.Regex.Match(Input,"(?<=DK call:\s+).*\n(?=Notice call)").Value
you can try this regex expression it will work and it will only pick the text from from the in between
DK call: and Notice call:
(?<=DK call:)\s{0,}.*\s{0,}(?=Notice call:)
STRINPUT : - “DK call: AB.1227.12
Notice call:”
try this in assign activity
System.Text.RegularExpressions.Regex.Match(STRINPUT,"(?<=DK call:)\s{0,}.*\s{0,}(?=Notice call:)").Value.Trim
output : -
@darie.leolea
lrtetala
(Lakshman Reddy)
October 26, 2023, 10:52am
10
Hi @darie.leolea
System.Text.RegularExpressions.Regex.Match(Input,"((?<=:\s*).*\d+)").Value
Hope this helps!!
Yogeesh_G
(Yogeesh G)
October 30, 2023, 3:09pm
11
Hi
Try this expression
Output_Val = Text.RegularExpressions.Regex.Match(“DK call: AB.1227.12”,“(?<=DK\scall:\s).+”).ToString
Thank you
system
(system)
Closed
November 2, 2023, 3:10pm
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.