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

Question

Question

Regex Issue with Laserfiche Connector

asked on August 10, 2016

I've got a client using the Laserfiche Connector that will be matching client names in a web application with documents in their repository.  I need to extract the Last Name only and run a simple search on the Last Name in Laserfiche.

The web application does NOT isolate the Last Name anywhere.  It only list the name as follows:

Title First Last, Suffix

I could have any of the following names listed

Mr. John Doe, Jr.

Mr. John Doe

Dr. John Doe, III

So, I know the Last name will always be either the last word or the last word before a comma.  To handle this, I'm using the following regular expression:

(\w+),|\s(\w+)$

The /(\w+),/ handles any instance where a comma is in the expression and the /\s(\w+)$/ handles any instance where there is no comma.  The | ties the two together.

Individually, both regular expressions work fine.  I can test them in the token dialog and they behave as expected.  Together, they correctly identify any name with a comma but returns a blank result on any name that does not have a comma.

I've tried this expression on regular expression testers on line as well as the pattern match activity in Laserfiche workflow.  It works great everywhere I've tried except the Laserfiche connector.

So, my question would be:  Is this a limitation of regular expressions with the Laserfiche connector?  If so, are there any plans to update it in the near future?

I'm also not opposed to other ways to identify names.  I've tried some regular expressions with positive lookaheads with even worse results.  But there's probably a bunch of different ways to tackle what I'm doing.

0 0

Answer

SELECTED ANSWER
replied on August 11, 2016 Show version history

Hi Peter,

This issue is a bug, which has been filed in our internal system (SCR 147896). This issue will be fixed in LF Connector 11.

Currently the workaround to get the last name for your case, you could use the following regular expression:

 (\w+)($|,)

 

A better workaround is

([a-zA-Z\-]+)(?:,\s\w+){0,1}$

This regular expression will handle both the suffix and hyphenated last names.

Thanks,

Juan

0 0

Replies

replied on August 15, 2016

Thanks Juan.  Appreciate the feedback and workaround!

0 0
replied on August 15, 2016

You are welcome. A better workaround for your case is the following one,

([a-zA-Z\-]+)(?:,\s\w+){0,1}$

This regular expression will handle both the suffix and hyphenated last names.

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

Sign in to reply to this post.