|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm really weak with regular expressions, and need to write one that handles a variable number of digits.
Here's part of a message that I receive: name="Key" value="1069632612"> '); The value may have more or less digits. When I originally wrote an expression, I did it cheap and dirty with this: /name="Key" value="(dddddddddd)/i but of course it broke a short while later when I received a shorter key value. Can someone help me out with this? Thanks! |
|
#2
|
|||
|
|||
|
Try using something like this
([0-9]*) or specifying the lower and upper limits of the number of digits ([0-9]{3,6}) Oh and RTFM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Help with PERL Regular Expression |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|