Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Paul Procacci
Thank you Bruce, This does indeed help. Like I mentioned to Joseph I have yet to test it but because it's coming out of the SF Study group I imagine it works. ;) I'll certainly make noise if it doesn't. Appreciate the time given to a follow-up. ~Paul On Sun, Nov 8, 2020 at 7:42 PM Bruce Gray

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Paul Procacci
Thank you Joseph, Your response along with Bruce's response (which I'll respond to separately) I presume works. My hopes of fitting this into a one liner are crushed! lol Nah, just playing. Thank you for taking the time to respond. This certainly helps with my project. ~Paul On Sun, Nov 8, 2

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Bruce Gray
> On Fri, Nov 6, 2020 at 8:23 AM Paul Procacci wrote: > > > > So two example patterns are: > > > > [\\u0009\\u000A\\u000D\\u0020-\\u007E\\u0085\\u00A0-\\uD7FF\\uE000-\\uFFFD\\u1-\\u10]* > > [\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]* > > > > To note, the RE's themselves cannot be changed as they are

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Joseph Brenner
I think this kind of thing does what you're after: use Inline::Perl5; my $p5 = Inline::Perl5.new; my $p5pat = '\w+'; $p5.run( 'sub chk { $_[0] =~ m/' ~ $p5pat ~ '/ }' ); subset p5_words of Str where { $p5.call( "chk", $^a ) }; my p5_words $a = "alpha"; say $a; # alpha, perl5 word chars, so acce

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread William Michels via perl6-users
Thank you Paul! On Fri, Nov 6, 2020 at 8:57 AM Paul Procacci wrote: > > Hi Bill, > > Yes, that is exactly what I'm saying. > > https://github.com/rakudo/rakudo/issues/2624 > > " FWIW, the :P5 supports a Perl 5 like syntax from X versions ago (probably > about 5.8, I would say)." > > The features

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Paul Procacci
Hi Bill, Yes, that is exactly what I'm saying. https://github.com/rakudo/rakudo/issues/2624 " FWIW, the :P5 supports a Perl 5 like syntax from X versions ago (probably about 5.8, I would say)." The features I need are in perl 5.10 which the :P5 adverb doesn't provide. Thanks, Paul On Fri, Nov

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread William Michels via perl6-users
Hi Paul, I'm sorry, I don't understand. Are you saying you're using Inline::Perl5 because you can't use the "Perl compatibility adverb" :Perl5 or :P5 ? https://docs.raku.org/language/regexes#Perl_compatibility_adverb Is that what you mean when you say the "perl regex engine [in Raku] is too old

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Paul Procacci
So two example patterns are: [\\u0009\\u000A\\u000D\\u0020-\\u007E\\u0085\\u00A0-\\uD7FF\\uE000-\\uFFFD\\u1-\\u10]* [\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]* To note, the RE's themselves cannot be changed as they are fed externally. Given that I'm stuck with these RE's which I believe are PCRE, I

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Brad Gilbert
I'm pretty sure you need to use single quotes for your example, as Raku will replace the @_[0] before Perl has a chance to do anything with it. On Thu, Nov 5, 2020, 10:23 PM Paul Procacci wrote: > https://github.com/niner/Inline-Perl5 > > use Inline::Perl5; > > subset test of Str where EVAL "sub

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Parrot Raiser
Can you provide some samples of what you are trying to match and exclude? There might be alternative solutions.

Subset w/ Inline::Perl5 RE as constraint

2020-11-05 Thread Paul Procacci
https://github.com/niner/Inline-Perl5 use Inline::Perl5; subset test of Str where EVAL "sub {@_[0] ~= m/\w+/}", :lang; Question: Can you pass whatever {*} into eval for use in Inline::Perl5 a la subset? The above example is incomplete, I understand, however I'm looking to find a method of cons