Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-11-05 19:17
Flavor·Python

r"
^ab.*[zy].*s
"
Open regex in editor

Description

Write a regular expression to find all words which have the first two characters of "ab", and after that at some point EITHER a "z" or a "y", and then after that at some point an "s". The "s" does not have to be at the end of the word.

So the following words are all examples of words which you should be able to find (although there are many more words which match which are not listed here):

Submitted by anonymous