minestrone More fingers than teeth Thanks received 182 Jul 27, 2011 14:35 #1 I can never work this stuff out. I am looking for a reg exp that only takes 9 numbers, what I have just now is "\d{9}" and it is letting . - and spaces through. Anyone know a expression that suits? Cheers.
I can never work this stuff out. I am looking for a reg exp that only takes 9 numbers, what I have just now is "\d{9}" and it is letting . - and spaces through. Anyone know a expression that suits? Cheers.
Y yasockie Fingers like lightning Thanks received 6 Jul 27, 2011 14:43 #2 Where are you evaluating your regexp? In any case did you try [0-9]{9} or even [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ?
Where are you evaluating your regexp? In any case did you try [0-9]{9} or even [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ?
minestrone More fingers than teeth Thanks received 182 Jul 27, 2011 14:56 #3 yasockie said: Where are you evaluating your regexp? In any case did you try [0-9]{9} or even [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ? Click to expand... Java server faces code, validateRegExpr tag [0-9]{9} looks promising, cheers. I look at reg exp about once a year and always spend 10 minutes trying to get my head round it.
yasockie said: Where are you evaluating your regexp? In any case did you try [0-9]{9} or even [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ? Click to expand... Java server faces code, validateRegExpr tag [0-9]{9} looks promising, cheers. I look at reg exp about once a year and always spend 10 minutes trying to get my head round it.
fullyautomatix Godlike Thanks received 139 Jul 28, 2011 00:27 #4 minestrone said: Java server faces code, validateRegExpr tag [0-9]{9} looks promising, cheers. I look at reg exp about once a year and always spend 10 minutes trying to get my head round it. Click to expand... Same with me. Have read tons of stuff to make myself an expert at it but still cannot get my head around it at times. It really is the work of devil.
minestrone said: Java server faces code, validateRegExpr tag [0-9]{9} looks promising, cheers. I look at reg exp about once a year and always spend 10 minutes trying to get my head round it. Click to expand... Same with me. Have read tons of stuff to make myself an expert at it but still cannot get my head around it at times. It really is the work of devil.
VectraMan Lord of the Vectras Thanks received 233 Jul 28, 2011 18:12 #5 I put off learning this stuff for 20 years in IT, but recently was forced to for a gig. It's actually pretty clever. This I found very helpful: Regular Expressions Reference - Basic Syntax Is it a string in Java? I.e. do you mean: "\\d{9}"? Failing that, I've always found it's better to make it match the start and end: ^\d{9}$
I put off learning this stuff for 20 years in IT, but recently was forced to for a gig. It's actually pretty clever. This I found very helpful: Regular Expressions Reference - Basic Syntax Is it a string in Java? I.e. do you mean: "\\d{9}"? Failing that, I've always found it's better to make it match the start and end: ^\d{9}$