Jump to content
Sign in to follow this  
Guest sjana

regular Expression

Recommended Posts

Guest sjana

I want to check if all digits in a string are same. E.G. my valid sets are

1. 9999999999

2. 99-99-99999

The regexp which I could come up is


The above regexp match 1. but cant match 2. I need a regexp which can match both 1. and 2. thanks in advance

Share this post

Link to post
Share on other sites

this script can do the test for you:



If StrTest($a,$:whistle:=1 then

msgbox(0,"","$a is Equal to $b")


msgbox(0,"","$a Not Equal to $b")


Func StrTest($S1,$S2)

$ignore="-,/,$" ; Place here the chars to ignore



$S2b=$S2 ; Fill teststring

; Remove all specified Ignore characters from the Test string

For $x = 1 to $chars[0]

$S2b = StringReplace($S2b,$chars[$x],"")


If $S1=$S2b then return 1

return 0


Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites
Guest sjana

Thanks for the reply, however my requirement is a single regular expression rather than a function. Basically i need it as part of struts validation.

Share this post

Link to post
Share on other sites

The back-referencing you are asking for is on the TO DO list. I am trying to get more fundemental fixes done, before implementing it. I will be at my parent's place from Dec 22 to Jan 4, so very little development (but much relaxation) will occur then. I hope to get things finshed on the weekend and submit to Jon on Monday or Tuesday.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.