[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Re: Regular Search and Replace on a key?



In message <1098e3e150.wra1th@xxxxxxxxxxxxxxx> you wrote:

> I am not quite sure why you would want to. For uploading webpages to
> servers you need to use relative URLs everywhere - ones that do not have
> the http:// prefix. The script I wrote was predicated on converting
> relative RISC OS pathnames to relative URLs.

If the slashdot function is to cope with parent directories it needs also
to convert ^ to .. . Thus:

 slashdot = \(s)
   local slash,dot,dot2,up,pat = '/','.','..','^','[%.%^/]'
   local change = {[slash] = dot,[dot] = slash,[up] = dot2}
   =>(s:gsub(pat,change)) end

I suppose it ought also to change & to . but I have never seen anybody
describe a relative path "foo" as "&.foo". So maybe it is best to let
sleeping ampersands lie.

-- 
Gavin Wraith (gavin@xxxxxxxxxxxxxxx)
Home page: http://www.wra1th.plus.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx