Delete all characters on a line after a space

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
silly
Posts: 2
Joined: Thu Oct 28, 2010 2:25 am

Delete all characters on a line after a space

Post by silly »

Hello, I was looking for a macro or a regular expression that will allow me to delete everything in a line after the first space throughout the document. For example,

email@address.com texttobedeleted
another@emailaddress.com moretexttobedeleted

This would keep the email addresses, or whatever other text that is on the line, but will delete everything that comes after that first space.

Thanks!
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

In the Replace dialog:

Find what: _.* (replace the underscore with a space)
Replace with: (nothing, or a space if you want to keep the space after the email address)

Ensure the Regular expression check box is selected.
silly
Posts: 2
Joined: Thu Oct 28, 2010 2:25 am

Post by silly »

Thanks for your help!
Post Reply