Forum Moderators: phranque

Message Too Old, No Replies

Match characters and numbers

         

Dragosh

7:56 pm on Nov 28, 2007 (gmt 0)

10+ Year Member



Please tell me what syntax to use to match only characters and only numbers because (.*) matches everything and that's not what i need.
Thanks in advance, Dragos

Jon_King

8:33 pm on Nov 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A dash between two characters within a character class [] denotes the range of characters between them.

[a-zA-Z] matches all lowercase and uppercase letters from a to z, A to Z.

Dragosh

4:49 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



but what about numbers? how can i match only numbers?

jdMorgan

5:31 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please see the regular expressions tutorial cited in our forum charter [webmasterworld.com]. There are many others on the Web as well; A Web search may turn up one that you find more usable.

Jim

phranque

6:27 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



[0-9]
(matches one numeric character)