[Koha-bugs] [Bug 23873] Allow marc modification templates to use capturing groups in substitutions
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Feb 17 16:25:34 CET 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23873
Nick Clemens <nick at bywatersolutions.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #128981|0 |1
is obsolete| |
--- Comment #15 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 130760
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130760&action=edit
Bug 23873: Enable capture groups in MarcModificationTemplates
This patch adds support for regular expression capture groups in
MarcModificationTemplates.
We escape double quotes in the replacement string, then quote the whole
string before applying the `ee` modifier to the final regex application.
See
https://blog.james.rcpt.to/2010/10/25/perl-search-and-replace-using-variables/
for further details.
Test plan
1) Attempt to use capture groups in your regular expression based
MarcModificationTemplate and note it does not work.
2) Apply the patch and try again, this time the capture group should
yield the expected results.
3) Run t/SimpleMARC.t and confirm the tests still pass.
Signed-off-by: Andrew Fuerste-Henry <andrew at bywatersolutions.com>
Signed-off-by: Nick Clemens <nick at bywatersolutions.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list