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, |
In reply to Re: giving spaces
by Athanasius
in thread giving spaces
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |