Quote:
Originally Posted by vargr
After testing a few files with this, I have some more questions...
1) Is it possible to return the shortened form for both when there's more than one pair of names in the field separated by a comma?
|
This turns commas into slashes then computes the list of first names.
Code:
program: list_re(re(field('#text'), ',', '/'), '/', '^(..*?)\b.*$', '\1')
2) Can it account for " & " in place of "/", i.e., "John Doe & Jim Smith" to "John & Jim"? (This isn't as big a deal, but I do have some fields like that.)[/QUOTE]I assume that the spaces are around the names in the source and that you want them in the result. The second parameter to list_re is the separator. Change '/' to ' & '.
Code:
program: list_re(field('authors'), ' & ', '^(..*?)\b.*$', '\1')