Matching format of number

Shweta

Active Member
Hi,

Please help with below -

I have master data that contains column say - "Number Format" which contains the data like below in excel:
As you see, its only a 4 digit number and leading number is 1.
1234
1567

In the same way, I have another format:
P98765
87654
In this, the leading character is either P or can be some number. It is of 5 to 6 characters.

Now, I have input data say, Unique number which contains some data. And i need to match that data with this format one by one. How can I do that?
 

gil.silva

Active Member
You have two approaches:
  1. Use Regular Expressions (RegEx)
  2. Use the functions for Text manipulation
1. Regex expression:

1\d{3} | P\s{4-5} | \d{5-6}

2. Functions to manipulate text

(Len([number]) = 4 AND StartsWith([number], "1") ) OR (Len([number]) = 5 OR Len([number]) = 5 AND StartsWith([number], "P")
-> it needs some adjustments. but you get the idea.
 
Top