mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-19 09:00:58 +00:00
69ea21dc99
AF rules don't support associative arrays, so the named capturing groups are provided in the array only by their numeric keys. Bug: T374294 Change-Id: I53b39917e6677f3a5b8f68bcf0faebf48668ea27
8 lines
934 B
Raku
8 lines
934 B
Raku
get_matches('I am a (dog|cat)', 'What did you say?') === [ false, false ] &
|
|
get_matches('The (truth|pineapple) is (?:rarely)? pure and (nee*v(ah|er) sh?imple)', 'The truth is rarely pure and never simple, Wilde said') == ['The truth is rarely pure and never simple', 'truth', 'never simple', 'er'] &
|
|
get_matches('You say (.*) \(and I say (.*)\)\.', 'You say hello (and I say goodbye).') === [ 'You say hello (and I say goodbye).', 'hello', 'goodbye' ] &
|
|
get_matches('I(?: am)? the ((walrus|egg man).*)\!', 'I am the egg man, I am the walrus !') === [ 'I am the egg man, I am the walrus !', 'egg man, I am the walrus ', 'egg man' ] &
|
|
get_matches('this (does) not match', 'foo bar') === [ false, false ] &
|
|
get_matches('(?P<name1>foo) (?<name2>bar) (?\'name3\'baz)', 'foo bar baz') === [ 'foo bar baz', 'foo', 'bar', 'baz' ] &
|
|
get_matches('(?P<name1>foo) (?<name2>bar) (?\'name3\'baz)', 'lorem ipsum') === [ false, false, false, false ]
|