Regular expression in filters - RegExp $1 to $9 properties

Hi,

To see if I’ve described who is on my photos, I have created an attribute “Recognized persons” associated to each media with people on it and I have assigned it a value like number_recognized/total_persons_number.

What I want to do is to search for the unrecognized people on pictures so I have created an attribute filter:

Attribute: Recognized persons
Value: (\d{1,n})/($1)
Regexp: Checked

I reverse the filter to get only media with a Number of Recognized People different of total Number of People on the Picture.

But, it seems that (\d{1,n})/($1) don’t work - nor (\d{1,n})/$1.

Does this kind of regexp with $n properties implemented in Gramps?

1 Like

I am no expert on Regular Expressions but the link is what Gramps has on their use.

PS: can you edit the discussion header to better describe this Discussion is about “Regular Expressions in Filters” . My first thought was that you were selling something.

1 Like

:clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

I’ve found this working regular expression:

(?P<reco>\d+)/(?P=reco)

It seems expression I’d used before is a Java RegExp, Python RegExp works better.

Note that links in Regular Expressions wiki page Dave cited points to their wikipedia definition and the regexp web site. Usefull but not so usefull than to say we can use any python regexp defined into python manual. May be something to add to the manual.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.