Community Patterns

Community Library Entry

1

Regular Expression
Created·2024-05-24 10:19
Flavor·ECMAScript (JavaScript)

/
(?<sign>[+-])?(?<int>\d(?:[\d_ ]*\d+)?)(?:(?:\s*[,.]\s*)(?<decimal>\d(?:[\d_ ]*\d+)?))?
/
g
Open regex in editor

Description

  • Integers
  • Decimal value starts by comas or dots
  • Handle spaces, "_" characters
  • Signed or not

--> Visit https://flymeth.net to view my works

Submitted by anonymous