LinuxQuestions.org
Help answer threads with 0 replies.
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, 06: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 06:27 PM. Reason: More detail
 
Old 04-08-2014, 06: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:18 PM
Regular Expressions Wim Sturkenboom Programming 10 11-19-2009 02:21 AM
\{a,b\} regular expressions sycamorex Linux - General 10 10-18-2008 07:38 PM
Regular Expressions markjuggles Programming 2 05-05-2005 12:39 PM

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

All times are GMT -5. The time now is 12:24 PM.

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