/^([^,]*,){21}[^,]*$/
That is:
^ Start of string
( Start of group
[^,]* Any character except comma, zero or more times
, A comma
){21} End and repeat the group 21 times
[^,]* Any character except comma, zero or more times again
$ End of string
More Related Contents:
- How to extract all Yahoo emails from a .CSV file?
- Regular expression to remove fancy apostrophe [closed]
- Regular Expression for ” – ” and characters after [closed]
- What is a word boundary in regex?
- Escaping a forward slash in a regular expression
- Why doesn’t `\d` work in regular expressions in sed? [duplicate]
- In regular expressions, what is a backtracking / back referencing?
- Regular expression for youtube links
- How can I use ‘Not Like’ operator in MongoDB
- Zero-Length regexes and infinite matches?
- Regex pattern for HH:MM:SS time string
- Fully qualified domain name validation
- Fixing Catastrophic Backtracking in Regular Expression
- apache HTTP:X-Forwarded-Proto in .htaccess is causing redirect loop in dev environment
- Dollar sign in regular expression and new line character
- What do \S, \W, \D stand for in regex?
- Using RegEX To Prefix And Append In Notepad++
- How to match the first word after an expression with regex?
- When is it best to use Regular Expressions over basic string splitting / substring’ing?
- Is there any way to put malicious code into a regular expression?
- Design DFA accepting binary strings divisible by a number ‘n’
- Replace all whitespace with a line break/paragraph mark to make a word list
- Regex matching beginning AND end strings
- hgignore: help ignoring all files but certain ones
- Why do regex engines allow / automatically attempt matching at the end of the input string?
- Regex return file name, remove path and file extension
- How do I turn any regex into an complement of itself without complex hand editing?
- Apache mod_rewrite REDIRECT_STATUS condition causing directory listing
- Matching url with array list of words in AngularJS ui-router
- Guide on how to use regex in Nginx location block section?