Home > other >  Validate LibreOffice cell contents against a REGEX
Validate LibreOffice cell contents against a REGEX

Time:01-11

I need to enforce a column cell validity against a REGEX.

So I ask if it is possible to validate a cell (really all cells in a column) agaist a REGEX.
I see we have data validity custom formula option, but I can't find any docs about how to use it to validate against a REGEX...

Can anybody help?

CodePudding user response:

The condition worked for me Formula is

AND(ISERROR(REGEX(E9;"^[0-9]{11}$"));ISERROR(REGEX(E9;"^[A-Za-z]{6}[0-9]{2}[A-Za-z]{1}[0-9]{2}[A-Za-z]{1}[0-9A-Za-z]{3}[A-Za-z]{1}$"));ISERROR(REGEX(E9;"^[A-Za-z]{6}[0-9LMNPQRSTUV]{2}[A-Za-z]{1}[0-9LMNPQRSTUV]{2}[A-Za-z]{1}[0-9LMNPQRSTUV]{3}[A-Za-z]{1}$")))

Yes, it is very long and difficult to edit. Perhaps, if you think about the problem long enough, you can come up with a shorter expression.

Long Condition

Update By the way, Custom Validity

  •  Tags:  
  • Related