On 2012-07-27 16:58, Andy Bach wrote:

  if ($model=~/(\S+)\s+(.*)\s*$/) {

The \s* in the end does nothing.

Closer:
    /(\S+)\s+(.*\S)/


Then play with this:

perl -Mstrict -we'
  my $data= $ARGV[0] ? q{Ford} : qq{ \t Fiat Ulysse 2.1 TD    };
  printf qq{<%s> <%s>\n}, split( q{ }, $data, 2 ), q{oops};
  printf qq{<%s> <%s>\n}, $data =~ / (\S+) \s* ( (?: .* \S )? )/x;
' 1

<Ford> <oops>
<Ford> <>

--
Ruud


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to