Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(([(|\[](?P<series>[^)\]]*)[)|\]]))?((?P<author>.*[^\s][^\-])[\s]+-[\s]*)?(?P<title>[^(]*)([(|\[](?:[\s]*(?P<published>(([12][\d]{3,3})(?:(?!([^.\)\-a-zA-Z_]*(-+[^.\)a-zA-Z_]+)+)))))?)?[\s]*([,]?[\s]*(?P<publisher>[\s\w\s]*)[\s]*)?([,]?[\s]*(isbn:|isbn[-]?13:)?(?P<isbn>[0-9-]+))?[)|\]])?
/
gim

Description

for adding books

Submitted by anonymous - 6 years ago