From: Family Tree Mike on
On 4/28/2010 11:11 AM, Family Tree Mike wrote:
> On 4/28/2010 9:07 AM, John Devlon wrote:
>> Hi,
>>
>> Does anyone have a solution for the following problem:
>> I would like to split a string into 2 strings by the first occurense of a
>> number.
>>
>> Example:
>>
>> "Londen street 52" into "Londen street" and "52"
>> "New york harbor 52 dock 2" into "New york harbor" and "dock 2"
>>
>> Does anyone have a solution?
>>
>> Thanx
>>
>> John
>>
>>
>>
>> __________ Informatie van ESET Smart Security, versie van database
>> viruskenmerken 5067 (20100428) __________
>>
>> Het bericht is gecontroleerd door ESET Smart Security.
>>
>> http://www.eset.com
>>
>>
>>
>>
>
> Depending on your answer to the question regarding keeping the 52 in the
> first example, then the following regular expression should work.
>
> (.*?)(?:\d+)(.*)
>

I see your reply to another post that you want the number in the second
string. This means the reqular expression should be:

(.*?)(\d+.*)

The earlier example did not capture the number portion in the second
capture.

--
Mike