Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(?<=^| and )((?:(?:.\.|[\w\-\u00C0-\u017F]+)\s*)(?:(?<! and )(?:.\.|[\w\-\u00C0-\u017F]+)\s*)*) ([\w\-\u00C0-\u017F]+)(?= and |$)
/
gm

Description

Convert a citation author list from

Pierre Racine and Luc Lauzon and Daniel Lesieur

to

Racine, Pierre and Lauzon, Luc and Lesieur, Daniel

Submitted by anonymous - 2 years ago