Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?x)^(?P<crt>crt) (?: (?: (?:_) (?P<sm>start_mode)(?P<ul>_)?(?P<smq>(?(ul)normal|ep)) | (?: (?P<bool>[01])\B (?:_ (?: (?: (?P<dual>dual(?P<dq>ch)) | (?P<ext>extended)(?P<q>ch|da|ep) | (?P<std>standard) | (?P<bstr>\w*)) ) | ) | (?: (?: (?P<digit>[2-9])(?:_)(?P<str>\w*))) ) ) )$
"
gm

Description

Matches the names of all the C startup modules found in the library. Should also match similarly-named modules.

Minimizing capture groups and clarifying(?) capture group names

A work in progress!

Submitted by anonymous - 4 years ago