LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-08-2014, 05:17 PM   #1
pikov
LQ Newbie
 
Registered: Apr 2011
Posts: 5

Rep: Reputation: 0
Help with vim and regular expressions


I have a file, each line of which consists of a variable number of space-separated text strings, the last of which being an email address in the usual form xxxx@yyyyy.zzz

I'm looking for a way to either delete everything except the email addresses or to extract the email addresses to another file.

Can someone please help? TIA.

PS: The actual format of a line is:

[letters and spaces][SP][2 digits][SP][letters][SP][letters][SP][3 digits][SP][3 digits][SP][4 digits][SP][email address]

Last edited by pikov; 04-08-2014 at 05:27 PM. Reason: More detail
 
Old 04-08-2014, 05:58 PM   #2
pikov
LQ Newbie
 
Registered: Apr 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Never mind. I used a find string of .*\d\d\d\d[SP] and replaced it with nothing.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] vim: question about regular expressions JosephS Linux - Software 3 09-22-2011 05:18 PM
Regular Expressions Wim Sturkenboom Programming 10 11-19-2009 01:21 AM
\{a,b\} regular expressions sycamorex Linux - General 10 10-18-2008 06:38 PM
Regular Expressions markjuggles Programming 2 05-05-2005 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration