LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  How to find strings with numbers in them?

    Employee
    Posted 05-20-2015 09:07

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Leaner

    Hi,

    Trying to clean up addresses, I need to find post codes.

    I'm using this in a split node:
    isAlphaNum('1:d_County')
    So something like "AB54 CX43" is not giving me the desired output as post codes have spaces in them, the IsAplhaNum spits them out as false (as it should according to your docs) because of the spaces. I thought about removing the spaces, but this is not an option as the space is not always located in the same place, ie. 4 characters in, so I can't put them back later.

    Is there a better way to find if a string contains numbers as well?

    Thanks.


  • 2.  RE: How to find strings with numbers in them?

    Employee
    Posted 05-20-2015 09:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    try this:

    isAlphaNum('1:d_Country'.replace(" ",""))

    That will drop out the spaces and then test for alpha+digits.. without changing the incoming data.


  • 3.  RE: How to find strings with numbers in them?

    Employee
    Posted 05-21-2015 07:29

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Leaner

    Originally posted by: stonysmith
    					

    try this:

    isAlphaNum('1:d_Country'.replace(" ",""))

    That will drop out the spaces and then test for alpha+digits.. without changing the incoming data.
    Tried that, still would not recognise simple strings as "E14". I even went to the extent of removing spaces in a prior filter, still things like "SW10XP" would still come up as false. Probably a bug on that method.

    Finally got it to work by approaching this from the other side, isAplha('1:d_County'.replace(" ","")) work perfectly.

    Thanks.