Jump to content

Recommended Posts

Posted (edited)

Hello,

I have a string with [] (bracket in english ?).

I want remove this [] but i have an error.

What's wrong plz ? :D

$text = 123[456]789

$text = StringReplace($text, "[", "")

$text = StringReplace($text, "]", "")

Thx :D

Edited by gimx
Posted

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, "]", "")

Posted

Ok i've seen my prob.

For example, my "real" string is : 12[34]5(67)89

First, i want delete all digit between the (), the result would be : 12[34]589

And 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 :D

Posted

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

Posted

Aaahhh yes sorry, damn escaped char...

I didn't know we can add multiple pattern with | char.

Thx Xeno :D

Posted

Aaahhh yes sorry, damn escaped char...

I didn't know we can add multiple pattern with | char.

Thx Xeno :D

| is an OR

Glad 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...