>
>       <span class="navbar">&gt; <a href="forumdisplay.php?f=327">Main Support
> Categories</a></span>
>
>       <span class="navbar">&gt; <a href="forumdisplay.php?f=331">General
> Help</a></span>
>       <td class="navbar" style="font-size:10pt; padding-top:1px" 
> colspan="3"><a
> href="/showthread.php?p=9948797"><img class="inlineimg"
> src="images/misc/navbits_finallink_ltr.gif" alt="Reload this Page"
> border="0" /></a> <strong><span style="font-weight: bold; color:
> #980101;">[ubuntu]</span> help please i can boot in to ubuntu 10.10 using a
> usb
>
> For example if this is the case then the
> First string will be     ->    href"
> and second string will be a double quote ->    "
> to extract all the hyperlinks
> If suppose we have a log file where
> 456:3455 fft rohit :78
> 457:3445 fft mala :78
> 458:3455 fft shyam :78
> if we want to extract all the names from this log file then the
> first string will be fft space
> and second string will be a space
> So if I have a generic regular expression, that will help me a lot.

if you are looking for a regex. that elas with only one line at a
time: <string1>(.*)<string2>
in Perl or python this should be enough, the result will be in some variables.
I prefer, awk, and in awk and variants you will have to use
match(function). Result will be first element in array.
eg (from "GAWK: Effective AWK Programming"):
$ echo foooobazbarrrrr |
> gawk ’{ match($0, /(fo+).+(bar*)/, arr)
> print arr[1], arr[2]
> print arr[1, "start"], arr[1, "length"]
> print arr[2, "start"], arr[2, "length"]
> }’
a foooo barrrrr
a 1 5
a 9 7

sed/grep, I don't know if such a thing is possible.


-- 
Lots o' Luv,
Phani Bhushan

Let not your sense of morals prevent you from doing what is right -
Isaac Asimov (Salvor Hardin in Foundation and Empire)

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

-- 
l...@iitd - http://tinyurl.com/ycueutm

Reply via email to