Hi Mak,
I'm master of Perl regex. :-)
This simple program explain, how to extract first sequense of exact nine digits from a string.
The found nine digits are not preceded or followed any digit.
Sorry for my English (I studied German).
#!/usr/bin/perl -w
use strict;
my $s='012-34-56789 123-45-6789 012-34-5678';
my $result;
our $temp;
print "$result\n" if $s =~ /(?{local $temp=''})(?<!\d)(\d(?{$temp.=chr vec($s,pos($s)-1,8)})-?){9}(?![\d-])(?{$result=$temp})/;
# Output: 123456789
Regards,
Serge
http://www.gameintellect.com