Skip to content

Instantly share code, notes, and snippets.

@hihebark
Last active August 12, 2020 10:35
Show Gist options
  • Save hihebark/f5a53cac9a70b3def347abbef419359b to your computer and use it in GitHub Desktop.
Save hihebark/f5a53cac9a70b3def347abbef419359b to your computer and use it in GitHub Desktop.
Regex to Match Numbers in Plain french from 1 to 100 JavaScript
/((?:(quatre(\-)?(vingt(s)?)?(\-)?(un|deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|(dix(\-(sept|huit|neuf))?))?)|(soixante(\-)?(deux|trois|quatre|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|(dix(\-)?(sept|huit|neuf)?))?)|(dix(\-)?(sept|huit|neuf)?)|(vingt(\-)?(deux|trois|quatre|cinq|six|sept|huit|neuf)?)|(trente(\-)?(deux|trois|quatre|cinq|six|sept|huit|neuf)?)|(quarante(\-)?(deux|trois|quatre|cinq|six|sept|huit|neuf)?)|(cinquante(\-)?(deux|trois|quatre|cinq|six|sept|huit|neuf)?)|(cent)|(zero|un|deux|trois|cinq|six|sept|huit|neuf|dix|onze|douze|treize|quatorze|quinze|seize|(dix(\-)?(sept|huit|neuf)?)))[\s|et|\-|\/|_]*){5,}/ig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment