Regex validation format

Hi how are things. your help please.

I need to do a format validation on an excel column.

the validation is that the data complies with the following format.

123456789123-1-1

I mean: nnnnnnnnnnn-n-n any number but the last two are divided by hyphens

Hi @alexis.mendoza

You can use a Regex.IsMatch.

Like this in an Assign

Left Assign
Boolean_Result

Right Assign
System.text.regularexpressions.regex.IsMatch(input_String, “ \d{12}-\d-\d”)

Then use an IF statement to validate whether ‘Boolean_result is true.

Hopefully this helps

Cheers

Steve

image

I need to apply that comparison to a data table,

Filter the rows that in that column do not comply with the format.

Hi @alexis.mendoza

I would achieve this by:

  • making a new column called ‘Match’ and set the results to TRUE and FALSE.
  • Then filter the results based upon the ‘Match’ column being TRUE and
  • Then remove the column.

Hopefully this helps.

Cheers

Steve

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.