Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: matching n'...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 13 Topic 2216 of 2241
Post > Topic >>

Re: matching n'th pattern...

by gazelle@[EMAIL PROTECTED] (Kenny McCormack) Apr 6, 2008 at 04:17 PM

In article
<cd1f41f3-cfd5-4b25-a5cd-144db4532de0@[EMAIL PROTECTED]
>,
tomekl  <tomek@[EMAIL PROTECTED]
> wrote:
>Hello !
>
>I'm trying to get text between given html tags, for examle for this
>pattern:
>
>foo<li>a</li><li>b</li><li>c</li>bar
>
>I'd like to get
>a for parameter 1
>b for parameter 2
>c for parameter 3
>
>What I've tried so far is this:
>
>echo 'foo<li>a</li><li>b</li><li>c</li>bar' |  gawk
>'{ b=gensub("(.*)<li>([^</li>]*)</li>(.*)","\\2",X) ; print b }'
>
>but it returns c no matter of X value, could you help me please?

I suppose you could try:

FS = "<[^>]*>"




 13 Posts in Topic:
matching n'th pattern...
tomekl <tomek@[EMAIL P  2008-04-06 08:56:07 
Re: matching n'th pattern...
gazelle@[EMAIL PROTECTED]  2008-04-06 16:17:02 
Re: matching n'th pattern...
tomekl <tomek@[EMAIL P  2008-04-06 09:23:23 
Re: matching n'th pattern...
pk <pk@[EMAIL PROTECTE  2008-04-06 19:51:48 
Re: matching n'th pattern...
pk <pk@[EMAIL PROTECTE  2008-04-06 19:56:43 
Re: matching n'th pattern...
tomekl <tomek@[EMAIL P  2008-04-06 09:25:13 
Re: matching n'th pattern...
tomekl <tomek@[EMAIL P  2008-04-06 10:46:07 
Re: matching n'th pattern...
tomekl <tomek@[EMAIL P  2008-04-06 10:50:01 
Re: matching n'th pattern...
pk <pk@[EMAIL PROTECTE  2008-04-06 20:21:09 
Re: matching n'th pattern...
pk <pk@[EMAIL PROTECTE  2008-04-06 20:46:42 
Re: matching n'th pattern...
tom <tomasz.lutelmowsk  2008-04-06 11:49:09 
Re: matching n'th pattern...
Ed Morton <morton@[EMA  2008-04-06 14:06:02 
Re: matching n'th pattern...
Peter Jasper <usenet77  2008-04-08 02:43:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 4:34:59 CDT 2008.