?
Solved

Regex Help

Posted on 2015-01-09
4
Medium Priority
?
98 Views
Last Modified: 2015-02-11
Hello EE,

I have a huge text file and I need get only the strings where :

Always some letters at the beginning (but never numbers), then always  the character   :   then always some letters and/or numbers

so something like this would work:

abcd: test1234

that wouldnt work :
April 24, 1946: abcd1

that wouldnt work:
abcd:

can you help? thanks!
0
Comment
Question by:PhilippeRenaud
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 70

Expert Comment

by:Qlemo
ID: 40540640
I'll assume the characters following the colon are arbitrary, then this regex should work:  '[a-zA-Z]+:.*[a-zA-Z0-9]+'
0
 
LVL 20

Assisted Solution

by:n2fc
n2fc earned 1000 total points
ID: 40540645
Might not be the best...
But this works:

[A-Za-z]+\:[A-Za-z0-9]+

You can try it out here:
http://regexpal.com/

or here:
http://www.regexr.com/
0
 
LVL 84

Accepted Solution

by:
ozo earned 1000 total points
ID: 40541724
^[a-zA-Z]+:\s*[a-zA-Z0-9]+
0
 
LVL 1

Author Closing Comment

by:PhilippeRenaud
ID: 40604114
sorry for delay guys..thanks
0

Featured Post

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question