Regular Expressions 101

Community Library Entry

0

Regular Expression
Python

r"
(?<=^\*page)(?P<pg>[\d]{1,3})|(?<!;)(?P<txt_a>[  ].*)(?=\[lr\]\n)|(?<!;)(?P<txt_b>^[ ]{2}.*)|(?P<txt_c>@align anchor=\"center\" text=.+)|(?P<txt_d>^[^*@[;].+)
"
gm

Description

Attempting to parse Fate/Stay Night scripts nicely

Submitted by anonymous - a year ago