michaelslamet Posted September 12, 2013 Share Posted September 12, 2013 (edited) One of my small script need user input, which is only accept minus sign (with or without), number(s), comma(s) and dot(s). So if user input: 1-1233455678.12121,1999 or 11233455,678.12121.1999 it will considered as valid and this is considered as invalid: 1123-345a because it contain character "a" Currently I can check if the string is consist of A-Z or a-z by using StringRegExpReplace($sString, "[A-Z]", "") If @extended > 0 Then $valid = False StringRegExpReplace($sString, "[a-z]", "") If @extended > 0 Then $valid = False Thank you Edited September 12, 2013 by michaelslamet Link to comment Share on other sites More sharing options...
Solution Mat Posted September 12, 2013 Solution Share Posted September 12, 2013 So you want something like: "[^-,d.]". There I am matching anything that is NOT - or , or 0-9 or . michaelslamet 1 AutoIt Project Listing Link to comment Share on other sites More sharing options...
michaelslamet Posted September 12, 2013 Author Share Posted September 12, 2013 So you want something like: "[^-,d.]". There I am matching anything that is NOT - or , or 0-9 or . Haha, yes, Mat. Thank you very much That solve my problem 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