Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

[SOLVED] How to check if there is some number in a string?

$
0
0
Is it possible to check if there is AT LEAST few numbers (digit) in a string AND AT LEAST few hypen ("-") in a string?

For example:

$at_least_number = 4
$at_least_hypen = 2

then

"abcde812" --> false, because there are only 3 numbers on the string AND there is no hypen ("-") in the string
"abcde8112" --> false, because even there are 4 numbers (or more) in the string, the hypen is <= 2
"abcd-e8112-11" --> true, because there are 4 numbers (or more) in the string and there are 2 (or more) "-" in the string
"---43" --> false, because even there are only 2 (or more) "-" in the string, there are only 2 numbers in the string

Thanks in advance :)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>