Web based family history software

Question help with regex for birth

  • HerzScheisse
  • Topic Author
  • Away
  • New Member
  • New Member
More
1 month 4 weeks ago #1 by HerzScheisse
help with regex for birth was created by HerzScheisse
Hey,

I've been searching for a while to solve this.... but somehow i cant get it to work...

does any of you know how to search for people with no "1 BIRT" entry in the gedcom data?

I was using the new modules from sevtor to eliminate these error and could solve a couple... but there are some more people, which i cant find via the "missing facts" report... so i tried to find them in the datafix -> search&replace...

webtrees 2.1.19 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
1 month 4 weeks ago #2 by fisharebest
Replied by fisharebest on topic help with regex for birth
Code:
^((?!\n1 BIRT).)*$

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Topic Author
  • Away
  • New Member
  • New Member
More
1 month 4 weeks ago - 1 month 4 weeks ago #3 by HerzScheisse
Replied by HerzScheisse on topic help with regex for birth
thanks Greg...

thats what i tried with finding from the net... but i forgot the "\n" but even with it like in your example it doesnt find anything...

webtrees 2.1.19 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"
Last edit: 1 month 4 weeks ago by HerzScheisse.

Please Log in or Create an account to join the conversation.

More
1 month 4 weeks ago #4 by fisharebest
Replied by fisharebest on topic help with regex for birth
Sorry. Forgot that "." doesn't match "\". (I was in a meeting and couldn't really test it).

Try:
Code:
^((?!\n1 BIRT)(.|\n))*$

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Topic Author
  • Away
  • New Member
  • New Member
More
1 month 4 weeks ago #5 by HerzScheisse
Replied by HerzScheisse on topic help with regex for birth
okay no problem...

Yeah awesome... that works... cool now i can fix this entries :)
Thank you

webtrees 2.1.19 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
1 month 4 weeks ago #6 by drblam
Replied by drblam on topic help with regex for birth
   

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Topic Author
  • Away
  • New Member
  • New Member
More
1 month 4 weeks ago #7 by HerzScheisse
Replied by HerzScheisse on topic help with regex for birth
i'm using it in the admin panel via the data fix -> Search&replace function

i dont replace anthing there... just finding people and edit them in new browser tabs

webtrees 2.1.19 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
1 month 4 weeks ago #8 by drblam
Replied by drblam on topic help with regex for birth
 

Please Log in or Create an account to join the conversation.

  • HerzScheisse
  • Topic Author
  • Away
  • New Member
  • New Member
More
1 month 4 weeks ago #9 by HerzScheisse
Replied by HerzScheisse on topic help with regex for birth
Search method -> regex ;-)

webtrees 2.1.19 - modules: all vesta, faces, legal notice, privacy policy, fancy treeview, fancy research links
Linux Ubuntu | PHP 8.3.3 | MariaDB 10.5.23 | rewrite_urls="1"

Please Log in or Create an account to join the conversation.

More
1 month 4 weeks ago #10 by drblam
Replied by drblam on topic help with regex for birth

Search method -> regex ;-)
Thanks! That gave me 57 results, which is better than zero but way less than 500.  I will take care of these and look further....

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #11 by Franz Frese
Replied by Franz Frese on topic help with regex for birth
I get an error message:

 
 

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #12 by fisharebest
Replied by fisharebest on topic help with regex for birth
To see the actual error message, webtrees.net/faq/xhr

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #13 by Franz Frese
Replied by Franz Frese on topic help with regex for birth
Is this enough for analyse?:
SQLSTATE[42000]: Syntax error or access violation: 1139 Got error 'repetition-operator operand invalid' from regexp (SQL: select `i_id` from `webindividuals` where `i_file` = 1 and `i_gedcom` REGEXP ^((?! 1 BIRT)(.| ))*$) …/vendor/illuminate/database/Connection.php:712

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #14 by fisharebest
Replied by fisharebest on topic help with regex for birth
What version of MySQL are you using?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago - 1 month 3 weeks ago #15 by Franz Frese
Replied by Franz Frese on topic help with regex for birth
? this
MysqlI Supportenabled
Client API library version
mysqlnd 8.3.2

MySQL 5.7
Last edit: 1 month 3 weeks ago by Franz Frese.

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #16 by fisharebest
Replied by fisharebest on topic help with regex for birth
I would expect this error on MySQL 5.7 and earlier. These versions only supported "simple" regular expressions.

> versionmysqlnd 8.3.2

This is the PHP driver version number. The MySQL database may be older.

Can you run this SQL statement to confirm.
Code:
show variables like 'version';

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #17 by Franz Frese
Replied by Franz Frese on topic help with regex for birth
crossed:
MySQL 5.7

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #18 by hermann
Replied by hermann on topic help with regex for birth
I have the same error as Franz. MySQL 5.7. 

Hermann
Designer of the custom module "Extended Family"

webtrees 2.1.20 (all custom modules installed, PHP 8.2, MariaDB 10.6) @ ahnen.hartenthaler.eu

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #19 by fisharebest
Replied by fisharebest on topic help with regex for birth
MySQL 5.7 uses "simple" (POSIX) regular expressions.
MySQL 8.0 uses "full" (PCRE) regular expressions.
See dev.mysql.com/doc/refman/8.0/en/regexp.html

If you want to use reguler expressions that contain "look-ahead/behind" patterns, then you need to upgrade MySQL.

Also, MySQL 5.7 reached "end of life" in October 2023. It is advisable to upgrade.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #20 by Franz Frese
Replied by Franz Frese on topic help with regex for birth
Herman has the same provider as me.
We have no direct influence for change of version.
 

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}