Hello guys,
trying to compute the regexp for this problem, but I can't get it right.
Here is the string
the string is only composed of at maximum one of each of the following letter A, F, P, and G.
and it can include all the them (so max size is 4)
so a valid result could be
A
AG
APG
AGF
GFAP
but not
FAGF
nor obviously
AFGZ
I came up with
regexp -- {[A|F|G|P]{1,4}} $string
but it is obviously way too simple and does not work in all case.
Anyone has an idea???
trying to compute the regexp for this problem, but I can't get it right.
Here is the string
the string is only composed of at maximum one of each of the following letter A, F, P, and G.
and it can include all the them (so max size is 4)
so a valid result could be
A
AG
APG
AGF
GFAP
but not
FAGF
nor obviously
AFGZ
I came up with
regexp -- {[A|F|G|P]{1,4}} $string
but it is obviously way too simple and does not work in all case.
Anyone has an idea???