View Single Post
Old 04-07-2023, 03:49 PM   #8321
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,112
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Any objections if I add this to the "why isn't my regex working" section on ReplaceMetadata? (Or another section if you think it would fit better there.)

Code:
Regular expressions are case-sensitive. There are two ways around this. One is to put an [Aa] wherever you may expect varying capitalization:

```replace_metadata:
## Matches 'mass effect big bang' and 'Mass Effect Big Bang'
 collections=>[Mm]ass [Ee]ffect [Bb]ig [Bb]ang=>Mass Effect Big Bang
```
The other is to add `(?i)` to the beginning of your match. This is a regex flag that ignores casing.

```replace_metadata:
## Matches 'mass effect big bang' and 'Mass Effect Big Bang' but also 'MASS EFFECT BIG BANG'
 collections=>(?i)Mass Effect Big Bang=>Mass Effect Big Bang
```
EDIT:
Quote:
Originally Posted by JimmXinu View Post
Feel free. You seem to have a more time to mess around with this stuff.
I blame this on it being April. The first signs of warm weather always tends to give me a touch of mania.

Last edited by ownedbycats; 04-07-2023 at 04:01 PM.
ownedbycats is offline   Reply With Quote