0
Remove Random String...
Explorer
,
/t5/coldfusion-discussions/remove-random-string/td-p/361928
Apr 10, 2008
Apr 10, 2008
Copy link to clipboard
Copied
I need to find a sting in a block of text and remove it...
How is this done?
For instance my text would be:
The quick brown fox jumped over the lazy dog.
I want to remove:
"quick brown fox" from that string...
Here is the catch, the string I want to remove will always start with "quick" and end with "fox", but "brown" may be blue, it may be green, it may be ugly, it may be anything... So in someway I need to have a script that looks for "quick" and looks for "fox" and remove those words and anything inbetween...
How is that done?
Thanks!!!
For instance my text would be:
The quick brown fox jumped over the lazy dog.
I want to remove:
"quick brown fox" from that string...
Here is the catch, the string I want to remove will always start with "quick" and end with "fox", but "brown" may be blue, it may be green, it may be ugly, it may be anything... So in someway I need to have a script that looks for "quick" and looks for "fox" and remove those words and anything inbetween...
How is that done?
Thanks!!!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
/t5/coldfusion-discussions/remove-random-string/m-p/361929#M32469
Apr 10, 2008
Apr 10, 2008
Copy link to clipboard
Copied
Bweno,
I'd probably use ColdFusion's REReplace() function (which requires understanding regular expression syntax), but you could also find the point at which "quick" ends and "fox" begins and use the RemoveChars() function to remove everything between the two.
I'd probably use ColdFusion's REReplace() function (which requires understanding regular expression syntax), but you could also find the point at which "quick" ends and "fox" begins and use the RemoveChars() function to remove everything between the two.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/coldfusion-discussions/remove-random-string/m-p/361930#M32470
Apr 10, 2008
Apr 10, 2008
Copy link to clipboard
Copied
bweno wrote:
>
> How is that done?
>
> Thanks!!!
>
Regular expression is how this can be done.
There is a lot to learn about regex, a simple example form you question:
<cfset stuff = refind("quick.+brown","The quick brown fox jumped over
the lazy dog.")>
>
> How is that done?
>
> Thanks!!!
>
Regular expression is how this can be done.
There is a lot to learn about regex, a simple example form you question:
<cfset stuff = refind("quick.+brown","The quick brown fox jumped over
the lazy dog.")>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

