Regular Expression Help Where Special Characters are Used

Hi,

I am looking to get a piece of string after a particular bit of text after reading in a page from a PDF.
So for example, there will be multiple lines extracted to a variable, but one of the lines will be something similar to the below.

Email Address sample@email.com (“the phone”) 9876543

I am looking to extract the number after the (“the phone”) piece of text.
Using Regex seems to throw errors for me as it doesn’t like the use of the " and the ().

Any help here is greatly appreciated.

Regards,
David

You can escape special characters in regex by using \

1 Like

Where would i use the \ ?
See below example of a regex, where would i place the .

System.Text.RegularExpressions.Regex.Match(outReadText,“(?<=(“the phone”) ).+”).ToString

Before ( and ) . For " it is not needed.
Please see regex101: build, test, and debug regex

1 Like

Legend, thanks for your help. :slightly_smiling_face:

1 Like

Hi Robert,

Still facing an issue when i try to use that expression in Studio. Please see below. Any ideas?

Add 2 " instead of one in the regular expression. The activity considers " as end of string.
image

1 Like

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