gseller Posted October 1, 2007 Share Posted October 1, 2007 I have been looking in the forum and hlpfile and cannot find anything like StringUpper and StringLower that will remove everything but a digit from a string? what I need is to be able to paste a telephone number in and as most people put a space or dash or even a dot I want to be able to submit and it remove all but the digits in a string.. Any ideas? Link to comment Share on other sites More sharing options...
weaponx Posted October 1, 2007 Share Posted October 1, 2007 MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace("419-333-5555", "[^0-9]", "")) Link to comment Share on other sites More sharing options...
aslani Posted October 1, 2007 Share Posted October 1, 2007 MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace("419-333-5555", "[^0-9]", "")) ^Yup very powerful function! I'm starting to like it too Check this out: $my_pnumber = "My Phone Number is: (419)333-5555" MsgBox(0, "Info", $my_pnumber) MsgBox(0, "Extracted Phone Number", StringRegExpReplace($my_pnumber, "[^0-9]", "")) [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
gseller Posted October 2, 2007 Author Share Posted October 2, 2007 OMGosh!! Thank you aslani & weaponx , I am so glad that wasn't a snake, woulda bit me on the bum.. LOL I searched and searched the helpfile and even glanced over this on but never put 2 and 2 together. 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