<commit_before>use v6;
use Test;

=begin kwid

  regex r { <?> | x <r> }

  "x" ~~ /<r>$/  should match "x", not "".

=end kwid

plan 20;

# L<S05/Extensible metasyntax (C<< <...> >>)>

my regex r { <?> | x <&r> }

ok "" ~~ /<&r>/, '"" ~~ /<r>/ matched';
is $/, "", 'with ""';
is $/.from, 0, 'from 0';
is $/.to, 0, 'to 0';

ok "x" ~~ /<&r>/, '"x" ~~ /<r>/ matched';
is $/, "", 'with ""';
is $/.from, 0, 'from 0';
is $/.to, 0, 'to 0';

#?pugs emit skip_rest 'infinite loop in PCR - XXX fix this before release!';
#?pugs emit exit;
<commit_msg>[recursive.t] niecza++ implements LTM, and thus detected that this test was wrong. Fixed by changing | to ||<commit_after>use v6;
use Test;

=begin kwid

  regex r { <?> | x <r> }

  "x" ~~ /<r>$/  should match "x", not "".

=end kwid

plan 20;

# L<S05/Extensible metasyntax (C<< <...> >>)>

my regex r { <?> || x <&r> }

ok "" ~~ /<&r>/, '"" ~~ /<r>/ matched';
is $/, "", 'with ""';
is $/.from, 0, 'from 0';
is $/.to, 0, 'to 0';

ok "x" ~~ /<&r>/, '"x" ~~ /<r>/ matched';
is $/, "", 'with ""';
is $/.from, 0, 'from 0';
is $/.to, 0, 'to 0';

#?pugs emit skip_rest 'infinite loop in PCR - XXX fix this before release!';
#?pugs emit exit;

{'fraction_non_alphanumeric': 0.28220338983050847, 'fraction_numerical': 0.022033898305084745, 'mean_word_length': 2.8344155844155843, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1735893', 'n_tokens_mistral': 551, 'n_tokens_neox': 527, 'n_words': 170}