Regex To Match Comma Delimited String

Category: Strings | Views Total: 13 views

A regular expression that parses and matches comma delimited strings.

/^([A-Za-z0-9]\s?)+([,]\s?([A-Za-z0-9]\s?)+)*$/

Matches:

  • 123,456
  • abc,def,ghi
  • abc123

Non-matches:

  • abc123,
  • ,abc123
Rate This Regex
Sending
User Review
0 (0 votes)

Leave a Reply