jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
This works great. However, it is also possible that nothing follows b..... In that particular case I would like $c tobe empty. However this is not the case, it contains: c 30.#! /usr/bin/perl $a = " a 10 b a2 s2 c 30" ; ($c) = $a =~ /^b\s+(.*?)$/m ; print "c is $c\n" ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regexp need a match characters and spaces
by GrandFather (Saint) on Mar 23, 2006 at 10:48 UTC | |
by reasonablekeith (Deacon) on Mar 23, 2006 at 11:17 UTC | |
|
Re: regexp need a match characters and spaces
by codeacrobat (Chaplain) on Mar 23, 2006 at 14:48 UTC | |
|
Re: regexp need a match characters and spaces
by jeanluca (Deacon) on Mar 23, 2006 at 11:44 UTC | |
by johngg (Canon) on Mar 23, 2006 at 14:48 UTC | |
by graff (Chancellor) on Mar 23, 2006 at 23:27 UTC | |
|
Re: regexp need a match characters and spaces
by berntsmr (Novice) on Mar 25, 2006 at 06:07 UTC | |
|
Re: regexp need a match characters and spaces
by doc_faustroll (Scribe) on Mar 27, 2006 at 05:22 UTC |