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

Re: [StrongED] Another S&R query

In article <3fe97fbf56.gavin@xxxxxxxxxxxxxxx>, Gavin Wraith
<gavin@xxxxxxxxxxxxxxx> wrote:
> In message <04686bbf56.Alan.Adams@xxxxxxxxxxxxxxxxxxxxxx> Alan
>           Adams <alan@xxxxxxxxxxxxxxxx> wrote:

> >FredFred0175423245789 BillMany876542335778 Joe FJoe F3457y89567268
> >
> >I want to remove the first part of the line IF it is duplicated
> >immediately afterwards.
> >
> >In the above, remove Fred from line 1, and Joe F from line 3.

> Yes. Use this Lua script

> #!lua for line in io.lines (arg[1]) do print ((line:gsub
> ("^(%D*)(%1%d.*)$", "%2"))) end

> It presumes that the repeated prefix contains no digits and that
> the postfix to be retained starts with a digit. -- Gavin Wraith
> (gavin@xxxxxxxxxxxxxxx) Home page: http://www.wra1th.plus.com/

I believe Nick Roberts, Rename can do this sort of thing. It does take
a bit of time to fathom out.


I'm sorry I don't have any examples.



To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at