On 2011-04-08 14:34, Shawn H Corey wrote:
my @words = split /\s+/, $string;
See perldoc -f split, about why you might want to write that as
my @words = split ' ', $string;
To get it to not capture any matches, use the non-capture parentheses:
@num = split /(?:(?:a|b)+)/, $x;
Does tha
On 04/08/2011 03:12 AM, Anirban Adhikary wrote:
Can anybody please explaing the meaning of the following regular expression
my $x = '12abc34bf5';
@num = split /(a|b)+/, $x;
YAPE::Regex::Explain is great for this:
[pdurbin@beamish ~]$ perl -MYAPE::Regex::Explain -e 'print
YAPE::Regex::Explai
This is a nitpick, but..
On Fri, Apr 8, 2011 at 9:34 AM, Shawn H Corey wrote:
> To get it to capture the sequence of a's and b's, use:
>
>
> @num = split /((?:a|b)+)/, $x;
>
> To get it to not capture any matches, use the non-capture parentheses:
>
>
> @num = split /(?:(?:a|b)+)/, $x;
>
split /[a
On 11-04-08 03:12 AM, Anirban Adhikary wrote:
my $x = '12abc34bf5';
@num = split /(a|b)+/, $x;
print "NUM=@num\n";
NUM=12 b c34 b f5
`split` normally splits a string by separating the string into segments
by the regular expression. The following split a string into "words",
that is, text
On 2011-04-08 09:31, Uri Guttman wrote:
this is how alternation works with grabbing.
And in case you wonder what 'grab' means:
the Perl documentation uses 'capture'.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
htt
sure..
On Fri, Apr 8, 2011 at 1:29 PM, Uri Guttman wrote:
>
> please always reply to the list. resend that to the list.
>
> uri
>
> --
> Uri Guttman -- u...@stemsystems.com http://www.sysarch.com --
> - Perl Code Review , Architecture, Development, Traini
> "AA" == Anirban Adhikary writes:
AA> my $x = '12abc34bf5';
AA> @num = split /(a|b)+/, $x;
AA> print "NUM=@num\n";
AA> NUM=12 b c34 b f5
AA> Does it mean split the string ,here separaters are 'a' or 'b'(one or
AA> more occurance because of + metacharacter).
AA> If it matches
Graeme McLaren wrote:
Morning all, would anyone be able to explain this regular expression:
/^[\w ,.!?\-'"\(\)\s]+$/
I'm going to read up on it but I'm in a hurry for this.
Everything inside [] defines a character class which is a list of
characters,
any one of which can match a single character i
Graeme McLaren [GM], on Wednesday, April 13, 2005 at 11:23 (+0100)
thoughtfully wrote the following:
GM> /^[\w ,.!?\-'"\(\)\s]+$/
string have to start and end (so string must contain) these
characters: [a-zA-Z0-9_-(white_spaces)...]
and all strings you can see there.
also " " therese should't be.