On 6 Kwi, 19:51, pk <p...@[EMAIL PROTECTED]
> wrote:
> tomekl wrote:
> >> FS = "<[^>]*>"
>
> > This one is close, but it gives me matches for each html pattern, I
> > didnt manage to write FS for particular html pattern (ex <li>...</
> > li>), but as I wrote before, I want to match only text between those
> > tags...
>
> If you don't provide more precise examples, it's difficult to help. This
> works with the input you showed, but might not be what you want:
>
> FS='foo<li>|</li><li>|</li>bar'
>
> but it's too obvious to be what you're looking for. Also, it assigns a,
b
> and c to $2, $3 and $4 respectively (not $1, $2 and $3), but this should
> not be a big problem.
>
> --
> All the commands are tested with bash and GNU tools, so they may use
> nonstandard features. I try to mention when something is nonstandard (if
> I'm aware of that), but I may miss something. Corrections are welcome.
For FS="<[^>]*>" it assings $2=a $4=b $6=c, to be more precise, I need
this regular expression to match only for particular pair of tags, for
example for <li> and </li>, so for the string:
'<html>foo<li>A<br></li><li><b>B</b></li><li>C</li>bar</html>'
I would like to have assigned to variable only A, B, and C strings...


|