Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regular expression question 1

Status
Not open for further replies.

lfc77

Programmer
Aug 12, 2003
218
GB
How do I do a regular expression which allows any sort of input, but has a fixed length (i.e. I have a password field that needs to be 8 characters, but can include any sort of characters such as A-Z, 0-9, !"£ etc).


Any help would be really appreciated.


Cheers,

lfc77
 
Try using the len function i.e



If len(password) <> 8 then
msgbox &quot;Password must be eight characters long&quot;
endif
 
if u still plan to use RegExps the pattern is:
pattern=&quot;^.{8}$&quot;

Known is handfull, Unknown is worldfull
 
Kris,

That's the regular expression I was looking for, thanks! What exactly does the '.' look for though?


Thanks,

lfc77
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top