Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

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

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 - 6 months ago