06-27-2012 02:19 AM
How can I seperate out or filter out some numbers from a alphanumeric string?
For eg:
if it is bslbfvbsh1.345
I want the bslbfvbsh in one indicator and 1.345 in the other indicator.
I have used the search/split string function but there you have to give the offset.
If there are thousand characters I don't want to count the number of characters in order to give the index.
Is there a way by which it can on its own filter out the string and numbers in different indicators?
06-27-2012 03:41 AM
Hello Sunny,
use the Match Pattern Node, there you can feed as search pattern "[0-9\.]+", then you get the numbers with period in the [Match substring]- output, the part before will be given back in the [before substring]- output.
06-27-2012 05:42 AM
06-27-2012 09:35 AM
@jcarmody wrote:
Your string resembled something I had read about in my youth.
Ah, regular expressions, you just have to love them. One note about th eabove regular expression is that it will match thing like 1....3 or ..2.5 and various other combinations. If your data could have such values you may want to change the regular expression to find exact valid numbers only. You could do this using "\d+\.\d+". You could refine it further if you may get a number such as ".123" in which case your regular expression could be "\.{0,1}\d+\.\d+".
Note: there are periods in my regular expressions preceeded by a '\'. The periods sort of get lost on the display depending on the resolution of your screen.
06-27-2012 12:38 PM
06-28-2012 12:57 AM
dave TW, jcarmody, Mark Yedinak, Darin K.
Thanks a lot!!![]()