Trong Posted May 2, 2016 Share Posted May 2, 2016 (edited) How to return only letters and number (A-Z, a-z,0-9)? EG: "A Bs3;4fốd'g" => ABs34fdg Local $InputString = "A Bs3;4fd'g" ; => ABs34fdg Local $sOutPut = StringRegExp($InputString, "[:alnum:]") Local $rOutPut = StringRegExpReplace($InputString, "[:alnum:]", "") ConsoleWrite("StringRegExp: " & IsArray($sOutPut) & " - " & $sOutPut & @CRLF) ConsoleWrite("StringRegExpReplace: " & IsArray($rOutPut) & " - "&$rOutPut & @CRLF) Thanks Edited May 2, 2016 by You Regards, Link to comment Share on other sites More sharing options...
Iczer Posted May 2, 2016 Share Posted May 2, 2016 #include <Array.au3> Local $InputString = "A Bs3;4fd'g" ; => ABs34fdg Local $sOutPut = StringRegExp($InputString, "[[:alnum:]]",3) Local $rOutPut = StringRegExpReplace($InputString, "[^[:alnum:]]", "") ConsoleWrite("StringRegExp: " & IsArray($sOutPut) & " - " & _ArrayToString($sOutPut,"") & @CRLF) ConsoleWrite("StringRegExpReplace: " & IsArray($rOutPut) & " - "&$rOutPut & @CRLF) Trong 1 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