Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-12-01 21:34
Flavor·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
Open regex in editor

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