user964946
user964946

Reputation: 69

In Notepad++, using regular expressions to delete something on each line starting with a certain character?

On each line, I have a list of pdfs followed by junk. Like:

yes.pdf xxxxxx
no.pdf aewrnnta
hello.pdf aewraewr

I would like to make it so I get

yes
no
hello

on three separate lines

How can I do this with regex?

Upvotes: 1

Views: 216

Answers (2)

ipr101
ipr101

Reputation: 24236

Try -

\.pdf.* in find box

and

'' in replace box

Make sure you have the RegEx radio button checked.

Upvotes: 4

BoltClock
BoltClock

Reputation: 724452

Find:

^([^.]*)\..*

Replace with:

\1

Upvotes: 1

Related Questions