Hi all,
How could i strip anything from a string between two [] ?
I looked at rereplace - but i dont know how to look for braces and their contents
| SitePoint Sponsor |


Hi all,
How could i strip anything from a string between two [] ?
I looked at rereplace - but i dont know how to look for braces and their contents





Start by escaping the braces, then go from there.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes

You could find the position of the "[" - opening bracket and the "]" closing bracket. Then use the RemoveChars(string, start, count) function, where start is the position of your "[" and end is calculated as position of "]" in the string minus the position of "[". If you want a more detailed explanation, post your code and we will help you.


incase it helps anyone I managed to adapt the code i found for stripping html and got this to work
Code:<cfset newTitle = Trim(REReplace(Title,'\[[^\]]*\]','','all'))>
Bookmarks