gimx Posted April 18, 2008 Share Posted April 18, 2008 (edited) Hello, I have a string with [] (bracket in english ?). I want remove this [] but i have an error. What's wrong plz ? $text = 123[456]789 $text = StringReplace($text, "[", "") $text = StringReplace($text, "]", "") Thx Edited April 18, 2008 by gimx Link to comment Share on other sites More sharing options...
monoceres Posted April 18, 2008 Share Posted April 18, 2008 You must have quotes around the first string. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
gimx Posted April 18, 2008 Author Share Posted April 18, 2008 Sorry, I forget them when i wrote the post, but they are in my script. $text = "123[456]789" $text = StringReplace($text, "[", "") $text = StringReplace($text, "]", "") Link to comment Share on other sites More sharing options...
gimx Posted April 18, 2008 Author Share Posted April 18, 2008 Ok i've seen my prob.For example, my "real" string is : 12[34]5(67)89First, i want delete all digit between the (), the result would be : 12[34]589And after, i want to delete the [].I try this code but it don't work for the first case :$text = StringRegExpReplace($text, "((.*?))", "")Thx for help Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 18, 2008 Share Posted April 18, 2008 Hi, try this: Global $str = "12[34]5(67)89" ConsoleWrite(StringRegExpReplace($str, '\(.*?\)|\[|\]', '') & @CRLF) Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
gimx Posted April 18, 2008 Author Share Posted April 18, 2008 Aaahhh yes sorry, damn escaped char... I didn't know we can add multiple pattern with | char. Thx Xeno Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 18, 2008 Share Posted April 18, 2008 Aaahhh yes sorry, damn escaped char...I didn't know we can add multiple pattern with | char.Thx Xeno | is an ORGlad I could help.Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now