in reply to giving spaces
If the regex does not have an x modifier, just use a literal space. If it does have an x modifier, put the space into a character class:
13:26 >perl -wE "my $s = 'a b'; say 'matched' if $s =~ /a b/;" matched 14:47 >perl -wE "my $s = 'a b'; say 'matched' if $s =~ /a[ ]b/x;" matched 14:47 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: giving spaces
by Anonymous Monk on Jul 17, 2013 at 04:54 UTC | |
by mtmcc (Hermit) on Jul 17, 2013 at 07:46 UTC | |
by Anonymous Monk on Jul 17, 2013 at 05:25 UTC | |
by BillKSmith (Monsignor) on Jul 17, 2013 at 14:09 UTC |