[Koha-bugs] [Bug 17661] Differences in field ending (whitespace, punctuation) cause duplicate facets

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 7 18:47:53 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17661

--- Comment #11 from Nick Clemens <nick at bywatersolutions.com> ---
(In reply to Katrin Fischer from comment #9)
> 1) Your regex always removes the first occurence, but we need the last.
> 2) . is not removed as it's not escaped in the regex (I think).
> 2) In case of "Date, C. J." we don't want the last, when it's preceded by a
> capital letter (very likely to be an initial).

1 - I had two different regexes, one was wrong
2 - period does not need to be escaped
3 - Done

I added eliminating spaces on either side of punctuation as well

Tested and played here to find cases:
https://regex101.com/

This is the base right now:
\s*(?<![A-Z])[.\-,;]\s*$

Let me know how that works

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list