Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace routine
#4
@bplus Thanks!

Note to anyone using html to test this: The routine is not an html parser, meaning it will not search wrap tags like <br> or <p></P>. It would also have to handle crap like &nbsp; (non-breaking space) and other html coding for quote marks and other punctuation that could be present. I did not want to venture down that rabbit-hole for this utility.

I did think up a way to determine the location in the original text of each search occurrence that needs to be replaced. This is just needed if the routine was to ever be incorporated into a wysiwyg or wp app. It would allow the text found to be highlighted.

I also think I thought up a way to put arrays in place of the string characters that I used to mark the search and replace positions. I'll code it late and see if it pans out.

Oh, @Kernelpanic In image #2 you searched for:

Burg Eisenhardt in BelzigĀ 

when you needed to search forĀ 

'Burg Eisenhardt' in Belzig

Not including the ' marks in the search is why it didn't find it. The routine is not case-sensitive, but that is as AI as it gets. So except for case, the search term needs to match exactly.

Thanks for testing it though. Very much appreciated!

Pete
Reply


Messages In This Thread
Replace routine - by Pete - 10-31-2024, 12:11 AM
RE: Replace routine - by Kernelpanic - 10-31-2024, 01:06 PM
RE: Replace routine - by bplus - 10-31-2024, 01:16 PM
RE: Replace routine - by Pete - 10-31-2024, 04:46 PM



Users browsing this thread: 3 Guest(s)