marginally off-topic

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Jan 28 21:06:01 EET 2002


On 2002-01-28 13:04:12, Constantinos Antoniou wrote:
> On Mon, 2002-01-28 at 11:46, Vasilis Vasaitis wrote:
> ..[snip]..
> > 
> > ..[snip]..
> > 
> >   Ta parapavw eivai unicode escapes ths SGML/XML. Gia va ta metatreyeis se
> > kati pio logiko, metatreye katarxhv to arxeio apo o,ti kwdikopoihsh
> > brisketai se UTF-8 (me to iconv(1) p.x.), kai meta metatreye kai ta escapes
> > se UTF-8 me kati sav to parakatw:
> > 
> > 	perl -pe 's/&#([0-9]+);/pack "U", $1/ge'
> 
> Don't you just love perl!?!?!?
> 
> (To epomeno stadio bebaia einai na katalabw ti egine, alla gia ayto tha
> RTFM)

substitute A ->B ( ge -> g : replace all A -> B
			 e : evaluate B for every match )

A -> &#([0-9]+);

	o xarakthras '&'
	o xarakthras '#'
	( regexp ) -> $1
		[0-9] -> ena ari8mhtiko pshfio
		[0-9]+ -> toulaxiston ena ari8mhtiko pshfio
	o xarakthras ';'

B -> pack("U",$1)
	$1 -> current match ( to A pou legame )

gia boh8eia sxetika me thn pack() des ta manpages ths perl,
arketa egrapsa :PPP

-- 
Giorgos Keramidas . . . . . . . . . keramida@{ceid.upatras.gr,freebsd.org}
FreeBSD Documentation Project . . . http://www.freebsd.org/docproj/
FreeBSD: The power to serve . . . . http://www.freebsd.org/



More information about the Linux-greek-users mailing list