[Koha-bugs] [Bug 29014] New: Unable to use full fledged Regular Expression with capture groups and repalce capability in MARC Modification Template Action Builder.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 14 15:16:29 CEST 2021


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

            Bug ID: 29014
           Summary: Unable to use full fledged Regular Expression with
                    capture groups and repalce capability in MARC
                    Modification Template Action Builder.
 Change sponsored?: ---
           Product: Koha
           Version: 20.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Tools
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: rajujogi.t at gmail.com
        QA Contact: testopia at bugs.koha-community.org

The RegEx used in MARC Modification Template Action Builder does merely help to
replace the value copied into a field/subfield from another MARK field/subfield
with some text (user specified). It also allows to add some prefixes or
suffixes to the value. However, it is not possible to replace the value with
first few characters of the value. It is also not possible to change the case
to UPPER or LOWER case. 

For this to work RegEx should allow for using capture groups and replacing the
value with the captured part of the value. For converting to upper or lower
case it should also allow for using utility modifiers such as \U (UPPER
entire), \L (lower entire), \u (UPPER first character), \l (lower first
character).

For example if we want to copy only the first 3 characters from the author
(100$a) subfield into Dewey (082$b) subfield and convert the case to UPPER
case, we should be able to specify RegEx like this 's/^([a-z]{3}]).*$/\U$1/ig'
and get the job done.

Intended result of applying this MARC modification template to a biblio record
:

MARC Modification Template Action: 
copy first 100$a to 082$b and replace the value with RegEx: 
  's/^([a-z]{3}]).*$/\U$1/ig'

Record before applying :
        100$a  - Akbar
        082$b  - some entry already existing or empty

Record after applying modification template: 
        100$a  - Akbar  
        082$b  - AKB

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


More information about the Koha-bugs mailing list