Re: how to add a space using a regex
- From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@xxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 10:38:44 +0200
"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?
--
Cheers,
Bernard
.
- Follow-Ups:
- Re: how to add a space using a regex
- From: Anno Siegel
- Re: how to add a space using a regex
- References:
- how to add a space using a regex
- From: Jerry Preston
- Re: how to add a space using a regex
- From: William James
- how to add a space using a regex
- Prev by Date: Re: how to add a space using a regex
- Next by Date: Re: how to add a space using a regex
- Previous by thread: Re: how to add a space using a regex
- Next by thread: Re: how to add a space using a regex
- Index(es):