Re: sed and html



On Mar 24, 3:48 am, "Greg Russell" <m...@xxxxxxxxxxx> wrote:
Greetings,

I'm needing to parse some html in order to extract specific groups of
information. My goal is to replace some specific tag groupings with "@"
using sed, then extract the desired fields using awk.

My problem comes when, for instance:

s|<span id=.*style="color:#f00;">|@|g

but I only want to make the substitution for the range of those characters
on each line in the file. The substitution above works on the entire range
of characters across multiple newlines in the entire file, which omits much
of the desired information.

Is there a way to modify the above expression please, so that only the first
group of those characters on each line are replaced?

it would be better if you provide some example html
.



Relevant Pages

  • Re: regex puzzle!
    ... will extract 400 characters from an HTML source, ... if any html opening tag is included in the first n ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: regex puzzle!
    ... will extract 400 characters from an HTML source, ... if any html opening tag is included in the first n ...
    (microsoft.public.dotnet.framework)
  • Re: regex puzzle!
    ... will extract 400 characters from an HTML source, ... if any html opening tag is included in the first n ...
    (microsoft.public.dotnet.general)
  • regex puzzle!
    ... The objective is to extract the first n characters of text from an ... HTML block. ... simply extracting the first 400 characters of a HTML ... closing tag being excluding. ...
    (microsoft.public.dotnet.languages.csharp)
  • regex puzzle!
    ... The objective is to extract the first n characters of text from an ... HTML block. ... simply extracting the first 400 characters of a HTML ... closing tag being excluding. ...
    (microsoft.public.dotnet.framework)