firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.24k stars 199 forks source link

I can't get to work character class intersection #1971

Closed VincentProuchet closed 1 year ago

VincentProuchet commented 1 year ago

Hello

I'm doing Quizz and can't get characters class intersection recognized I'm probabily doing it wrong.

I tried this : [\p{Lu}&&[^AEIOU]]/g

but I got this result :

Match a single character present in the list below [\p{Lu}&&[^AEIOU]

\p{Lu} matches an uppercase letter that has a lowercase variant

&&[^AEIOU matches a single character in the list &[^AEIOU (case sensitive)

] matches the character ] with index 9310 (5D16 or 1358) literally (case sensitive)

Global pattern flags 
g modifier: global. All matches (don't return after first match)

I even tried using the load exemple in editor, because I thougth I could be using the wrong && the & is recognize à a char to search and not its logical counterpart.

Please do not put the answer of the quizz thank you

working-name commented 1 year ago

Hello @VincentProuchet,

Thanks for your question! The whole quiz is evaluated by the PCRE2 engine which does not implement class intersections.

More information about which engines implement that is found here: https://www.regular-expressions.info/charclassintersect.html

The quiz is evaluated using the PCRE2 engine, which is also available in the main editor if you would like to do some testing. ~ https://regex101.com/quiz

VincentProuchet commented 1 year ago

thank you for that quick response I was wondering why it wasn't working. Now that I know the boundaries of the exercice It will be more "easier"