Need help with regex.match

Hi,

Here is my text file details sample:

Purpose of the change:
111 Upgrade this feature
112 Upgrade that feature
113 Upgrade those features
114 Upgrade these features

Change Description:
This change serves to do productivity improvement to the team.

Impact:
There is no impact

===================================================

I wish to retrieve all the data from 111 to 114 in ‘Purpose of the change:’

Please help!

Thanks and regards,
Woot

you need those digits too??
@wootberries24

is this what you looking for?
@wootberries24

1 Like

@wootberries24 Try using this Regex if you need the numbers as well :

1 Like

Yes i need the digits too, i want this to be my output:

111 Upgrade this feature
112 Upgrade that feature
113 Upgrade those features
114 Upgrade these features

Hmm, it doesn’t seem to be retrieving the outputs that I want. Is there a more specific way to retrieve from just ‘Purpose of the change:’? Because my text file actually has more texts that the sample above.

(?<=Purpose of the change:\s)(.|\n)*(?=Change Description)

you can try this @wootberries24

Cheers

2 Likes

@wootberries24 It was able to provide me those values with Matches Activity :sweat_smile: , Or the Format in which the Data is present in your file is Different, Hence the Match does not take place

My text file variable is ‘changeDetails’

Here is the details inside for just ‘Purpose of the change’:
123891/123893: detail 1
178447: detail 2
147858: detail 3
123583: detail 4

… (there may be more, depending on the changes)

Change Description:

When I used System.Text.RegularExpressions.Regex.Match(changeDetails,"\d+.*").Value
It only retrieved the first line of Purpose of the change

Output:
123891/123893: detail 1

did you try this?

2 Likes

Yes, this seems to be working for me.

Thank you so much! :slight_smile:

2 Likes

Cheers
@wootberries24
Happy Learning!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.