Regular expression question

M

Mic

Hi,

What would be the regex pattern for an alphanumeric string of exactly
12 characters with spaces allowed anywhere ?

Like:

" ab cd " is ok
"abc d" is ok

etc...


Thanks
 
G

Guest

Hi,

What would be the regex pattern for an alphanumeric string of exactly
12 characters with spaces allowed anywhere ?

Like:

" ab cd " is ok
"abc d" is ok


Try:

[0-9\s]{12}

0 - 9 and spaces, 12 characters long
 
L

Lloyd Sheen

Mic said:
Hi,

What would be the regex pattern for an alphanumeric string of exactly
12 characters with spaces allowed anywhere ?

Like:

" ab cd " is ok
"abc d" is ok

etc...


Thanks

I am not near my PC where I could answer this , but look for an app called
Expresso. Its free and written in Dot.Net. It has a great interface to
create and test regex.

Hope this helps
LS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top