Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: JAVA [[a-z]&&[^aeiou]] equivalence

by choroba (Cardinal)
on Jul 10, 2024 at 08:59 UTC ( [id://11160507]=note: print w/replies, xml ) Need Help??


in reply to JAVA [[a-z]&&[^aeiou]] equivalence

You need at least Perl 5.18 to use regex sets:
#!/usr/bin/perl use warnings; use strict; use experimental qw{ regex_sets }; my @match = grep /(?[ [^aeiou] & [a-z] ])/, map chr, 0 .. 255; print "match = @match\n";
Output:
match = b c d f g h j k l m n p q r s t v w x y z
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: JAVA [[a-z]&&[^aeiou]] equivalence
by Arunbear (Prior) on Jul 10, 2024 at 10:10 UTC
Re^2: JAVA [[a-z]&&[^aeiou]] equivalence
by Discipulus (Canon) on Jul 10, 2024 at 10:15 UTC
    Hello,

    nice info choroba. Glancing the doc you linked the following is even neater to my eyes:

    my @match = grep /(?[ [a-z] - [aeiou] ])/, map chr, 0 .. 255;

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^2: JAVA [[a-z]&&[^aeiou]] equivalence
by parv (Parson) on Jul 10, 2024 at 09:46 UTC

    Neat; learned something(regex sets).

Re^2: JAVA [[a-z]&&[^aeiou]] equivalence
by vincentaxhe (Scribe) on Jul 10, 2024 at 09:54 UTC
    great!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11160507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2025-06-14 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.