Dino Excel
Dino Excel

Reputation: 384

notepad++ regex insert value inbetween pattern

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

Answers (3)

Explosion Pills
Explosion Pills

Reputation: 191749

Try using either (.*?), or ([^,]+),. The former is preferred, but Notepad++ may not support it.

Upvotes: 1

nhahtdh
nhahtdh

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

woemler
woemler

Reputation: 7169

This should capture everything on a line up until and including the comma:

[^,]*?,

Upvotes: 1

Related Questions