[Edinburgh-pm] Dumb regex question
Chris Yocum
cyocum at gmail.com
Fri Jun 15 09:39:29 PDT 2012
On Fri, Jun 15, 2012 at 05:36:14PM +0100, Anthony Randell wrote:
> Odd - running this on strawberry perl 5.12 it works fine.
>
> I just get caínConchobor. What version are you using?
>
Huh, :(. I am using 5.14.2 on XUbuntu 12.04.
Chris
>
>
> On 15 June 2012 17:18, Chris Yocum <cyocum at gmail.com> wrote:
> > Hi Guys,
> >
> > Ok, I need to find all words that have a lower case letter followed by
> > an upper case one. I cannot seem to get it to work. Here is my
> > attempt. Note that this must be in Unicode because I have data with
> > accent marks in it.
> >
> > my @words = ("díne", "láechreraig", "caínConchobor");
> >
> > foreach my $word (@words) {
> > if($word =~ m/\p{IsLower}(?=\p{IsUpper})/) {
> > print "$word\n";
> > }
> > }
> >
> > The only word here that should be matched is "caínConchobor" and words
> > like it. Right now the regex matches all the words which isn't what I
> > was expecting.
> >
> > Thanks,
> > Chris
> >
> > _______________________________________________
> > Edinburgh-pm mailing list
> > Edinburgh-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/edinburgh-pm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: Digital signature
URL: <http://mail.pm.org/pipermail/edinburgh-pm/attachments/20120615/2de002fe/attachment.bin>
More information about the Edinburgh-pm
mailing list