LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-21-2012, 06:00 AM   #1
ravi_nandula
Member
 
Registered: Sep 2011
Posts: 81

Rep: Reputation: Disabled
About Regex


Hi Everyone ,

i came to know that Regex is used to make a regular expressions.
And i got an idea that suppose the 2 line

"Got facebook link"
"www.facebook.com"

These 2 need to be done using regex.

can anyone help me out
 
Old 06-21-2012, 06:05 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Quote:
These 2 need to be done using regex.
That's entirely unclear; exactly what do you want to 'do' ?

Also, which language are you using; there are a lot of slightly different regex engines/tools.
http://regex.info/
 
Old 06-21-2012, 06:07 AM   #3
ravi_nandula
Member
 
Registered: Sep 2011
Posts: 81

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
That's entirely unclear; exactly what do you want to 'do' ?

Also, which language are you using; there are a lot of slightly different regex engines/tools.
http://regex.info/
Those both line should appear as single line and......If I search with with search letter like "GO" it should direct me to facebooklink
 
Old 06-21-2012, 06:14 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Do you mean that you want to write a Regular Expression (Regex) that will match both lines? If so, there could be many answers that would NOT make sense----for example, these will all match both lines
Code:
grep '".*"' filename
grep '^"' filename
grep face filename
grep book filename
I think what you need is to define how to uniquely match those two lines in the context of many others---and you have to be precise in defining what the matching criteria are.
 
Old 06-21-2012, 06:21 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by ravi_nandula View Post
Those both line should appear as single line and......If I search with with search letter like "GO" it should direct me to facebooklink
This does not seem to have much to do with your first problem statement---please give a complete description of what you are trying to do.
 
  


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
regex help bradvan Programming 1 02-15-2012 08:30 AM
[SOLVED] differences between shell regex and php regex and perl regex and javascript and mysql golden_boy615 Linux - General 2 04-19-2011 02:10 AM
Perl to find regex and print following 5 lines after regex casperdaghost Linux - Newbie 3 08-29-2010 09:08 PM
regex with sed to process file, need help on regex dwynter Linux - Newbie 5 08-31-2007 06:10 AM
Need a regex, I suck at regex's d3funct Programming 4 02-25-2002 09:28 PM


All times are GMT -5. The time now is 11:02 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration