Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 (Beadle) 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 examining the Monastery: (5)
As of 2024-09-17 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (22 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.