Best practice for testing only numbers in alphanumeric field

Options

Hi. I am looking for the communities thoughts on best practice for testing only numbers exist in alphanumeric fields (useful for number only fields where we want to include leading 0s).

We are currently deciding on our standard approach. We currently use Regex as it's efficient and precise. The 'To Number' option is too dangerous as modifies the data (see pic for examples).

I have also seen this post with some other good ideas but wanted specific thoughts on best practice:


Thanks all

Best Answer

Answers

  • Jasper
    Options

    Seems like we were on our way to best practice with Regex but can enhance it with more specificity (e.g. negative, decimal) and make them reusable functions. This was exactly the sort of guidance I was after. Thank you Dan