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.