Reputation: 1180
Regex to find a string in C# which starts with a space and ends with a space and have one or more commas in between.
example MELVILLE 203 31-MAR-11 15 DENNY WAY, ALFRED COVE, 6154 WA $19,040 34 POOL
Here I want to get the DENNY WAY, ALFRED COVE, 6154 WA as output
Upvotes: 1
Views: 424
Reputation: 336478
@" .*?,.*? "
You didn't mention whether spaces are also allowed inside the string. If they aren't, use
@" [^ ]*,[^ ]* "
Upvotes: 2