Bug 29014 - Unable to use full fledged Regular Expression with capture groups and repalce capability in MARC Modification Template Action Builder.
Summary: Unable to use full fledged Regular Expression with capture groups and repalce...
Status: RESOLVED DUPLICATE of bug 23873
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: 20.11
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-14 13:16 UTC by T. Jogi Raju
Modified: 2022-02-19 18:38 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description T. Jogi Raju 2021-09-14 13:16:29 UTC
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
Comment 1 Katrin Fischer 2022-02-19 18:38:20 UTC

*** This bug has been marked as a duplicate of bug 23873 ***