[ciapug] regular expression help

Scott Phillips scott.phillips at DRAKE.EDU
Fri Aug 19 13:06:04 CDT 2005


Argh.  There is something seriously wrong with my brain today.

I want to pull out the one or two consecutive digits in a string like "Apr. 
1" or "Dec 22" using preg_match or something similar.  Can someone 
enlighten me?  Something like...

$pattern = "([0-9])|[0-9][0-9]";
$match = preg_match($pattern, $string);




Scott Phillips
Web Developer
Cowles Library, Drake University
(515) 271-2975 



More information about the ciapug mailing list