Re: how to add a space using a regex



Bernard El-Hagin <bernard.el-haginDODGE_THIS@xxxxxxxxxxxxx> wrote in comp.lang.perl.misc:
> "William James" <w_a_x_man@xxxxxxxxx> wrote:
>
> >
> > Jerry Preston wrote:
> >> What I want to do is add a space between one's name when the are
> >> like the following:
> >>
> >> $name1 = "FirstLast:";
> >>
> >> I want change $name1 = "First Last";
> >>
> >> and
> >>
> >> $name1 = "FirstMiddleLast:";
> >>
> >> I want change $name1 = "First Middle Last";
> >>
> >> To be able to add spaces for either "FirstLast:" or
> >> "FirstMiddleLast:" with the same regex?
> >
> > In Ruby:
> >
> > name1.gsub!(/(.)([A-Z])/,'\1 \2')
>
>
> Why would you think a Ruby solution would be of interest here?

Trolls troll -- they don't think much.

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.

--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
.



Relevant Pages

  • Re: copy contructor
    ... So you can inherit from as many inside-out classes as ... If you want to post a followup via groups.google.com, ... "Reply" at the bottom of the article headers. ...
    (comp.lang.perl.misc)
  • Re: question about pointer define
    ... If you want to post a followup via groups.google.com, ... "Reply" at the bottom of the article headers. ... For each new poster, it's the first time; ...
    (comp.lang.c)
  • Re: This is the end
    ... > and show things in a naturally temporal order? ... The correct way to post a followup is to quote *only* ... wants to re-read should be relegated to the bottom of the article, ... readers a favor and just don't post it ...
    (comp.lang.c)
  • Re: How to replace string in only one field which could be duplicated in the file
    ... I'm new to this kind of replacement, ... If you want to post a followup via groups.google.com, ... "Reply" at the bottom of the article headers. ...
    (comp.lang.perl.misc)
  • Re: Thou shalt have no other gods before the ANSI C standard
    ... Randy Howard wrote: ... "If you want to post a followup via groups.google.com, ... the broken "Reply" link at the bottom of the article. ... "Reply" at the bottom of the article headers." ...
    (sci.crypt)