I want to check given logical formulars with a regular expression.
The logical connectives for this form are & (and) , | (or), (!) negation sign (multiple negations allowed) and the variables are normal character sequences followed with cardinalities [0],[1],[0..1].
the variable names can also something be like this "F.G.H." or "F:G:H:" or simple "F" etc.
the square brackets belongs to the cardinalites.,lso constants are allowed,
e.g.
with this pattern it is not working:
Pattern.compile("([!]*[a-zA-Z][\\.])?([!]*[a-zA-Z][\\.]?)*((\\[0\\])?|(\\[1\\])?|(\\[0\\.\\.1\\])?)|(TRUE)|(FALSE)|(&)|(|)|(!)");
my current case that a variable like this: !!F[0] is not accepted, but i want this to be accepted.
here some examples for the formulars, which i want to allow
!!F[0] & !F1.G[0..1] | (F1[1] | F2[0]) & F:G[0..1]
also whitespaces between each element, except variables and their cardinalities shall be allowed.