Regex To Match Comma Delimited String

Category: Strings

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

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.