Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

Search and replace - last character is deleted 2 weeks 4 days ago #1

  • mike_jpr
  • mike_jpr's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 56
In the past I used the "Search and Replace" RegEx for the place and it work fine. I make an update with the actual version (2.0.19) and I wonder why the last letter is missing for each country

I use:
Search: 2 PLAC ([^,\n]*).([^,\n]*).([^,\n]*).([^,\n]*).([^,\n]*).([^,\n]*)
Replace: 2 PLAC $6, $1,$3,$4,$5
Search method: Regular expression

I try again and see that the last character has been deleted. Is that a bug or something has to be corrected in the RegEx?
Attachments:

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

Search and replace - last character is deleted 2 weeks 4 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 15173
I guess there's a logic error in your search pattern.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Search and replace - last character is deleted 2 weeks 4 days ago #3

  • mike_jpr
  • mike_jpr's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 56
I have been using it like this since version 2.0.2 and it worked.
What is now wrong?

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

Search and replace - last character is deleted 2 weeks 3 days ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 15173
> What is now wrong?

I guess that the final "D" in your text is being matched by the final "." in your pattern.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

Search and replace - last character is deleted 2 weeks 3 days ago #5

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 15173
Your regex has 5 "." - which I guess you assume will match a comma - but only 4 commas in your input string.

Therefore the final one is matching the final letter of the string.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

  • Page:
  • 1
Powered by Kunena Forum