Bernard El-Hagin wrote:
>
> Josef Möllers <> wrote in
> news::
>
> > Bernard El-Hagin wrote:
> >>
> >
> >> "François" <> wrote in news:blrqe4$i6a$1
> >> @s1.read.news.oleane.net:
> >>
> >
> >> > I want to replace an expression abc1234 to abc-1234 how can i do
> >> > I 've tried
> >> >
> >> > s/......./$1$2$3-$4$5$6$7/ but it dont work.
> >> >
> >> > Please help ?
> >>
> >
> >> s/(\D+)(\d+)/$1-$2/
> >
> > TMTOWTDI
> >
> > I'd use
> > s/(\D{3})(\d{4})/$1-$2/
> >
> > It's a little more robust when the abc1234 is not the only thing on a
> > line.
>
> s/abc1234/abc-1234/ is even more robust.
Why didn't I think of that B-{)))
> That's the problem with general specifications of problems.
Yes, you're right.
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett