Javascript / Perl Experts.....

  • Thread starter Thread starter snoopy
  • Start date Start date

snoopy

Guest
I have a piece of Perl that restricts characters for use as a password:

$FORM{passwrd1} !~ /\A[\s0-9A-Za-z!@#$%\^&*\(\)_\+|`~\-=\\:;'",\.\/?\[\]\{\}]+\Z/;

I'm moving lots of code over to AJAX and will perform this operation in JS. My problem is initialising a variable for using .test() on it.

I can not get the variable to accept many characters, such as = ; :

For example this wont work:

var filter_title = /^([a-zA-Z\=])+\$/;

Any ideas?
 
Snoopy: maybe try this...

var filter_title = /^\w+([\.-;:]?\w+)*+$/


It's not tested though!

Cheers... OneTrack


I have a piece of Perl that restricts characters for use as a password:

$FORM{passwrd1} !~ /\A[\s0-9A-Za-z!@#$%\^&*\(\)_\+|`~\-=\\:;'",\.\/?\[\]\{\}]+\Z/;

I'm moving lots of code over to AJAX and will perform this operation in JS. My problem is initialising a variable for using .test() on it.

I can not get the variable to accept many characters, such as = ; :

For example this wont work:

var filter_title = /^([a-zA-Z\=])+\$/;

Any ideas?
 


Back
Top Bottom