You are viewing limited content. For full access, please sign in.

Question

Question

LF connector edit token to only capture numbers

asked on March 13, 2023

Is it possible to edit a token in LF Connector and only capture the numbers that are in the token. Right now the token will only capture the employee's full name and then their employee ID in parenthesis.  I want to do the search just by the employee ID.

 

So we have Jane M. Doe (2003)  all I want is the 2003, but in the application, it is not a separate field, it is a combonation in the employee filed.

0 0

Answer

SELECTED ANSWER
replied on March 13, 2023

After you have the token which is grabbing the full value, you can use Regular Expressions (RegEx) from the Token Dialog to filter down to just want you want.

Here's a screenshot of a token taken from LFConnector doing an OCR of you actual post above:

There here is the token dialog, running RegEx on that text to specifically find one or more numbers surrounded by parenthesis and extract the number:

 

To break down the RegEx that I used:

  1. We start with:   \(   which means look for an actual open parenthesis.  Parenthesis are special characters in RegEx, so to define that are are speifically looking for one, we have to preface it with the \ character.  We do the same thing at the end with the closing parenthesis.
  2. Now we do an opening parenthesis:   (   this tells it to keep everything in between the opening and closing parenthessis.
  3. Now we say \d with a +.  The \d means any number characters, so 0-9 basically.  The + characters tells it to look for at lesat one of them, but it could be more.
  4. We do a closing parenthesis:   )   this is closing #2 above.
  5. We end with   \)   which is for the closing parenthesis - see #1 for more info.

 

So this is basically saying "look for 1 or more numbers surrounded by parenthesis and nothing else included, and extract those numbers".

1 0

Replies

replied on March 13, 2023

I actually found that about 15 minutes after posting.  Thank you!

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.