Reputation: 384
I need a regex matcher to find the pattern for a list consisting of a bunch of records
all of which end with a comma.
I want to, at the first occurrence of the comma insert beginning and end h1 tags.
I tried using (.*),
Upvotes: 0
Views: 148
Reputation: 191749
Try using either (.*?),
or ([^,]+),
. The former is preferred, but Notepad++ may not support it.
Upvotes: 1
Reputation: 56809
You can use this regex:
^([^,]*),
This will locate the string before the first comma in a line. There is also capturing group that captures the text before the first comma for reference in replacement.
Upvotes: 1
Reputation: 7169
This should capture everything on a line up until and including the comma:
[^,]*?,
Upvotes: 1