I am trying to grab any digits in front of a known line number of a phone, if they exist (in Perl). There will be no dashes, only digits.
For example, say I know the line number will always be 8675309. 8675309 may or may not have leading digits, if it does I want to capture them. There is not really a limit on the number of leading digits.
$input $digits $number
'8675309' '' '8675309'
'8008675309' '800' '8675309'
'18888675309' '1888' '8675309'
'18675309' '1' '8675309'
'86753091' not a match
/8675309$/
this will match how to capture the pre-digits in one regex?