Regular Expressions 101

Community Patterns

Find missing or superfluous commas in "For å" constructions.

1

Regular Expression
PCRE (PHP <7.3)

/
For å ([a-zA-Z0-9]+ ){1,5}(?:\bom\b|\bat\b)((?!,).)*\.|For å(?:(?!\bom\b|\bat\b).)*?,.*?\.
/
gm

Description

Finds missing commas in "For å ..." constructions according to officially ordained grammar-based comma rules.

Submitted by Eirik Birkeland - 9 years ago