Sign in to follow this  
Followers 0
supadodger

regexpreplace help plz...

4 posts in this topic

If Not StringRegExp($author[0], "[^ a-zA-Z0-9_\-]") Then
            StringRegExpReplace ($author[0],[b]"BLAH BLAH BLAH"[/b],"")
        EndIf

where it says blah blah blah is what i dont know what to put.

i need it to replace everything other than a-z 0-9 _ & -

ascii characters all that...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

i did a work around...

i put all the special characters in a text file then used filereadtoarray to replace each of them...

Dim $replace
        _FileReadToArray("StringReplace.txt", $replace)
        $po = 0
        Do
            $po = 1 + 1
            $URLS[$x] = StringReplace($URLS[$x], $replace[$po], "")
        Until $po = $replace[0]
Edited by supadodger

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Dim $author[1] = ['q+w#er-ty ***abc']
$author[0] = StringRegExpReplace($author[0], '[^ a-zA-Z0-9_\-]', '')
MsgBox(0, '', $author[0]);qwer-ty abc

Edited by dwerf

Share this post


Link to post
Share on other sites

That will probably not work as you want because $po = 1 + 1 is $po = 2 and will not increase $po! You can use $po += 1 instead.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0