Reputation: 71101
How would you grep through a set of files looking for any file that has a comma on a line by itself with this caveat. I want it to test true if the comma has whitespace characters before or after it.
Upvotes: 0
Views: 2800
Reputation: 35790
The regex for a single comma character on a line, surrounded by optional whitespace is:
/^\s*,\s*$/
Upvotes: 1