Regular Expressions 101

Community Patterns

INSEE code for french municipalities


Regular Expression
ECMAScript (JavaScript)



This is a regex that allows you to match INSEE codes for a french municipality.

It is different from a french postal code, because it can have "A" or "B" in its second character, used in codes for cities located in Corse.

Example: 2A004 for Ajaccio.

Submitted by thomasdom - 2 years ago (Last modified 2 years ago)