Sentence begins with Regular Expression

I need to extract data after the following words in a sentence from a document.
“Human Resources account 12/02/22 $1345.16 6/12/22”

Since I find words “Human Resources account” else where in the same document, I am trying to use a caret along with look behind.
(?<=^Human Resources account\s*).*

The above is not fetching me anything. Can you help? Thanks a lot,

Hi @A_Learner ,

Is it possible to provide us with the Data Sample where there are multiple matches found ?

Example data

Sample Organization Human Resources Account 1234 5678
Capital Parkway Capitol Hills DC
Human Resources Account 123999821 01/15/22 03/23/20 $182.96
When in emergency weather please check the web site.

**There are multiple amounts and dates through the document.

Why don’t you use RegEx to find the dollar amount and date specifically, using patterns that only match the dollar amount and date?

Thank you. There are multiple amounts and dates through the document.

Do you want all the dates and amounts? If not, you’ll have to identify a pattern to the one(s) you want.

@A_Learner
Why to use carot symbol the below will gives all the data after the word Human resourves account

(?<=Human Resources account\s*).*

If you want any other
Let me know

Cheers

Hi

Your sample data is different to your pattern, your pattern won’t match because of the capital A in Account.

Take a look at this pattern:

Cheers

Steve

@A_Learner

This should do your job

^Human Resources Account\s*.*

System.Text.RegularExpressions.Regex.Match(str,"^Human Resources Account\s*.*",RegexOptions.MultiLine).Value

Cheers

1 Like

Hi @A_Learner
Try this Regex in Find Matching Patterns activity:

(?<=Human Resources Account\s*).*

Hope it helps!!

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