Posted by kevin bailey on 04/10/06 03:25
hi,
it's really late and i'm struggling with this one - so any help gratefully
received.
if i have a string how would i strip out all characters except letters
between a-z and A-Z
i presume this would be using preg_grep but not being a regex guru is making
it hard.
would it be something like?
$subject = "abc-d%ef"; // Want i want to get back is 'abcdef'
$pattern = '/[a-zA-Z]*/';
preg_match($pattern, $subject, $matches);
// print_r($matches);
$cleaned_word = matches[0];
thanks,
kev
[Back to original message]
|