Extract number in string

1 post / 0 new
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57
Extract number in string

This request comes from the IDEA forums, as I can't attach a custom function I am adding it here.

The question was to extract a numeric portion of a text field in which there might be more than one numeric portion.  I am not sure if regexp would have worked, maybe Steve would know about this.  The example used was "PER John D Smith CUSTOMER 111111234 POINTS 183K" and the user wanted to extract the 111111234 portion, as they couldn't use @justNumbers as there are other number in their, the only way I could think of was to create a custom function but maybe some smart person can figure out how to do it directly in the equation editor.

The custom function takes two parameters, the first being the text or field holding the text and the minimum length of the numeric portion to extract.

Updated the custom function as of 12:48 April 9, 2015