What is the best way to create the equivalent of a โRegular Expressionโ (i.e., ^([1-9]{2}/[A-z]{6}(N)\d{6})$) for a โVALID_IFโ expression to create a data entry mask for column Data Validity?
Would you please open your expression with your own words so it would be easier for people to give an answer, thanks.
Total of 18 characters as follows:
The first two characters must be digits (1-9)
The next character must be a backslash ("/")
The next 6 characters must be letters
The next 3 characters must be โ(N)โ
The last 6 characters must be digits (0-9)
(in โRegular Expressionโ Code: ^([1-9]{2}/[A-z]{6}(N)\d{6})$
"next 3 characters must be โ(N)โโฆ do you mean they need to be like โNNNโ?
No, I mean the literal characters โ(N)โ, i.e., open para, N, close para
Everything except โnext 6 characters must be letterโ are easy to do. I need to think how it could be possible. I assume special characters are not allowedโฆ like [,(,@ etc.?
OK, how would you do the rest (excluding the 6 text characters)? In other words, I am interested in how to create this type of data validation mask in general (in addition to this particular format).
As for the text, is there a way to reference ASCII codes 65 to 122?
What if we allow ANY character for those โ6 text charactersโ to begin with? Update later if we/you find a way to limit to ASCIIโฆ
It could be something likeโฆ
AND(
NUMBER(LEFT(โ12/abcdef(N)123456โ,2))<100,
NUMBER(LEFT(โ12/abcdef(N)123456โ,2))>0, (assuming the first two digits are not โ00โ)
MID(โ12/abcdef(N)123456โ,3,1)="/",
IN(MID(โ12/abcdef(N)123456โ,4,1),LIST(a,b,c,d,e,f)),
โฆ
IN(MID(โ12/abcdef(N)123456โ,9,1),LIST(a,b,c,d,e,f)),
CONTAINS(MID(โ12/abcdef(N)123456โ,10,3),"(N)"),
NUMBER(MID(โ12/abcdef(N)123456โ,13,6))<1000000,
NUMBER(MID(โ12/abcdef(N)123456โ,13,6))>0 (assuming these last 6 digits are not โ000000โ)
)
Oh, what I wouldnโt give for regular expressions in AppSheetโฆ
User | Count |
---|---|
40 | |
34 | |
28 | |
23 | |
17 |