Rex

Post Reply
MiniMe
Posts: 210
Joined: Thu Mar 15, 2001 4:30 pm

Rex

Post by MiniMe »

Where is a good place to find materials to learn REX. For instance I am trying to figure out an expression that will match html comments, <!-- blah blah -->, so that I can sandr to strip them out of records before they are written to a file. But I have not had any luck finding one.
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

Rex

Post by Kai »

http://www.thunderstone.com/site/vortexman/node105.html describes REX and has a few examples. To match comments you might try ">><\!--=!-->+-->".

Another way to strip HTML comments from a document, if you also want to translate entities and interpret tags, is to format it with <fetch "http://localhost/foo.html" $data>. The second argument $data means that the given URL isn't fetched, but $data is taken as the page instead and is formatted and obtainable with <urltext>.
Post Reply