← Back to challenges

RegEx Repairs!

PythonHardregexbugs

Instructions

Help the drunken programmer fix his code! The RegEx string should be designed so it can reliably test if a string has an "A" at the beginning and end (case insensitive) as well as a "P" somewhere in between (also case insensitive).

Due to the use of fullmatch, no ending $ or beginning ^ match character is permitted anywhere except for the middle. Also, requirements have changed. Now, all characters must be allowed!

Notes

Go to the Tests tab for more help.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.