[Petal] Stripping XML declaration

Josh Narins josh at narins.net
Wed Jan 12 22:32:12 GMT 2005


> Hi Josh,
> 
> Please reply to the list in the future.

Sorry about that, I'm pretty new to mutt.  I'm on some other mailing
lists, but this is the first one I've replied to :)

> 
> > It would be 
> >  $processed =~ s#^ \s* <\?xml version="1.0"\?> \s* ##xs;
> >  #s to treat as single string
> >  #x to allow readability whitespace in the left hand side
> 
> Thanks for the regex. Did that work for you?

That didn't work, but this did...

s#^\s*<\?xml version="1\.0"\?>\s*##s;

I think I was missing an explicit whitespace indication between xml and
version in the first one.

> > I would definitely not recommend any sort of XML parser for this single
> > change, esp. since is defined as occuring at the beginning of the document.
> 
> I'd agree. I was just making suggestions. I prefer to look at all
> possible solutions and avoid premature optimization.
> 
> 
> Regards,
> William
> 
> -- 
> Knowmad Services Inc.
> http://www.knowmad.com

-- 
xplanet -body earth -transpng a.png -geometry "300x300-0+0" -origin sun
My politics        : http://satp.blogspot.com
Perl Programmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.webarch.co.uk/pipermail/petal/attachments/20050112/c87e9a65/attachment.bin


More information about the Petal mailing list