|
Posted by Aerik on 05/04/07 18:53
You're using split wrong - it's for "splitting it on boundaries formed
by the case-sensitive regular expression" - the regex is the dividing
boundary, not the text you're matching.
Try this:
$filename = 'C17AA001.000';
preg_match("/([0-9a-zA-Z]{5})([0-9]{3})(\.[0-9]{3})/",$filename,
$matches);
//print_r($matches);
list($x, $a, $b, $c,) = $matches;//discard x
echo $a;
echo $b;
echo $c;
Aerik (a tweener myself)
http://www.wikidweb.com - the Wiki Directory of the Web
[Back to original message]
|