Help with regex to create Gramps case-sensitive filter

GRAMPS: AIO64-5.1.4-1 on W10pro. I need a bit of help taming the Python implementation of regex within Gramps.

I am trying to set up a filter to find (in notes) particular data in title case, i.e. lower case with an initial capital. For certain instances, I want to reformat these to all upper case. I do not want to do it globally, but at the moment I cannot get it to work for any single string. I want to set up a custom filter into which I enter my target string, and can then work though the results to tidy up the data so there is consistent case-formatting.

It seems that the routines called by Gramps parse all text on a case-insensitive basis, so that if I search for e.g. “\bSmith”, with “use regular expressions” checked, I still get results containing all the instances of “SMITH”, which are already the vast majority of instances within my data, and also why I want a filter to find the very much smaller number of title-case instances so they can be fixed.

Even if I construct a regex using \u0000 to define each of the characters I am looking for, in its appropriate case, Gramps still returns all instances on a case-insensitive basis.

Is there some way of forcing a Gramps regex to be case-sensitive?

1 Like