Anbumani
(Anbumani)
1
Hi @mkankatala,
I need regex for entire description.
For example,
- Input:- E SECTION 123(B) NEGATIVE ADJUSTMENTS 45
Regex:- (?<=E SECTION 123(B) NEGATIVE ADJUSTMENTS).* Need pattern like this.
Expected Output:- 45
- Input:- C * SECTION 12(E)(3) EXPENDITURES STMT 20
Regex:- (?<=C * SECTION 12(E)(3) EXPENDITURES STMT).* Need pattern like this.
Expected Output:- 20
Note:- Here the input is one line but the one line description will flows in bulk of notes.
Thanks…!
hi @Anbumani
can you alter your regex with this?
(?<=E SECTION 123(B) NEGATIVE ADJUSTMENTS).*?(\d+)
Hi @Anbumani
Try below regex pattern
inputString = You String Description
System.Text.RegularExpressions.Regex.Matches(inputString,“(?<=\s)\d+$”)
Happy Automation 
Anbumani
(Anbumani)
5
Hi @smarthari1997,
I tried, but not have an luck. 0 matches found.
Please advise if I’m doing wrong.
Thanks…!
Yoichi
(Yoichi)
6
Hi,
If you need escaped regex pattern, the following sample will help you.
strEscapedPattern = System.Text.RegularExpressions.Regex.Escape("E SECTION 123(B) NEGATIVE ADJUSTMENTS")
Then
System.Text.RegularExpressions.Regex.Match(strInput,$"(?<={strEscapedPattern}).*").Value
Sample
Sample20240130-2.zip (2.5 KB)
Regards,
2 Likes
hi @Anbumani
i have altered it can you try with this
E SECTION 123(B) NEGATIVE ADJUSTMENTS (\d+)
if you still facing issue you can try with @Yoichi approach i believe that will solve your issue
Thanks!
mkankatala
(Mahesh Kankatala)
8
Hi @Anbumani
Check the below regular expressions,
Regex 1 -
(?<=E SECTION 123\(B\) NEGATIVE ADJUSTMENTS )(\d+)
Regex 2 -
(?<=C \* SECTION 12\(E\)\(3\) EXPENDITURES STMT )(\d+)
Hope it helps!!
Anbumani
(Anbumani)
9
Thanks @Yoichi,
It’s works as I expected…!
Appreciate it…!
1 Like
system
(system)
Closed
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.