Replace all ' and " on a multi-line text
Moderators: DataMystic Support, Moderators
Replace all ' and " on a multi-line text
I have just a small trial and error knowledge of regex patterns. My Problem: I want to eliminate the two characters (' ") with no replacement from a multi-line text. The multi-line text starts with
showTooltip(event,'
and ends with
');return false
All ' and " cause the tooltips to fail.
I have tried something with * in pattern style but my knowledge ist to small.
My settings are:
Find type: (Pattern (perl) and Action: Replace
So I am looking for help what to put in
textbox "Find Pattern (perl-style)"
and in textbox "Replace with"
I am not asking for a one-step-solution. I think it is easier to do the elimination in two steps.
thanks
showTooltip(event,'
and ends with
');return false
All ' and " cause the tooltips to fail.
I have tried something with * in pattern style but my knowledge ist to small.
My settings are:
Find type: (Pattern (perl) and Action: Replace
So I am looking for help what to put in
textbox "Find Pattern (perl-style)"
and in textbox "Replace with"
I am not asking for a one-step-solution. I think it is easier to do the elimination in two steps.
thanks
- DataMystic Support
- Site Admin
- Posts: 2235
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Set your first pattern to find perl pattern:
Replace with
Add a new search/replace and drag it inside the first one. Set it's perl pattern to:
Replace with nothing
Code: Select all
showTooltip(event,'.*');return false
Code: Select all
$0
Code: Select all
['"]
Regards,
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon,
Thanks for your prompt advice.
I still have the problem that all ' and " characters are replaced and not only such characters WITHIN the above specified part of the entire text.
I have illustrated the problem with two screenshots of the settings in Textpipe and have added some explanatory text. Would you please have a look at it. Maybe this is more specific.
http://quiz-center.de/tp.htm
thanks gerd
Thanks for your prompt advice.
I still have the problem that all ' and " characters are replaced and not only such characters WITHIN the above specified part of the entire text.
I have illustrated the problem with two screenshots of the settings in Textpipe and have added some explanatory text. Would you please have a look at it. Maybe this is more specific.
http://quiz-center.de/tp.htm
thanks gerd
- DataMystic Support
- Site Admin
- Posts: 2235
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
You need to drag the second search replace INSIDE the first one (in the tree view) as a subfilter. Please see the Tutorials in the Help menu
Regards,
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon,
I consulted the tutorials again but I am still struggling with the problem.
I have added a new screenshot which illustrates what I did.
http://quiz-center.de/tp.htm
I still get as an output that all of ' and " are replaced or none. Is there a chance to get a filter (.fll) by mail for it or may I call Australian support for it? Almost all my complicated Search & replace requests refer to subfilters which define a specific part of text in files to be searched and replaced. That is why I am very keen to know how it works.
thanks gerd
I consulted the tutorials again but I am still struggling with the problem.
I have added a new screenshot which illustrates what I did.
http://quiz-center.de/tp.htm
I still get as an output that all of ' and " are replaced or none. Is there a chance to get a filter (.fll) by mail for it or may I call Australian support for it? Almost all my complicated Search & replace requests refer to subfilters which define a specific part of text in files to be searched and replaced. That is why I am very keen to know how it works.
thanks gerd
- DataMystic Support
- Site Admin
- Posts: 2235
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Ok, the problem here is that it's only the text within the single quotes that needs to be subfiltered.
Change the pattern to:
and set the Action field to 'Send variable 1 to subfilter'.
This will prevent the initial and final single quote from being included. Turn on 'Prompt On Replace' to see it working
Change the pattern to:
Code: Select all
showTooltip(event,'(.*)');return false
This will prevent the initial and final single quote from being included. Turn on 'Prompt On Replace' to see it working
Regards,
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
It does not work neither this way or any other way.
I will probably give it up. I added the new screenshots and the example file
example text file
to demonstrate that it does not work this way. Thus, I have to do it manually or to consult a php or perl expert to do this in perl or php. This brings me to the question:
Replace given keywords from csv file into clickable URLs
which I will put into a new thread because I think this might interest quite a few people.
gerd
I will probably give it up. I added the new screenshots and the example file
example text file
to demonstrate that it does not work this way. Thus, I have to do it manually or to consult a php or perl expert to do this in perl or php. This brings me to the question:
Replace given keywords from csv file into clickable URLs
which I will put into a new thread because I think this might interest quite a few people.
gerd
- DataMystic Support
- Site Admin
- Posts: 2235
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Ahh - I see the problem. The top replace filter should be
because the ( and ) are special characters.
It works perfectly for me now!
Code: Select all
showTooltip\(event,'(.*)'\);return false
It works perfectly for me now!
Regards,
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads