in reply to extract numbers from unformatted text strings

You can always check for optional spaces where needed by using \s* to check for 0 or more whitescape characters:
$s =~ /(\d+)(?:to|thru|up to|\s*-\s*)(\d+)/;

What does your regex/string parsing code look like right now?