I am trying to build a logic which will check a string for matching pattern. The pattern to match is build like this :
+ = and
/ = or
Example of pattern : "a+(b/c)"
- which means that the string should contain "a" AND either a "b" or "c".
In this case the following strings should result in :
"ac" = true
"ab" = true
"abc" = true
"decfga" = true
"ad" = false
"bc" = false
"cb" = false
How would you do this in PHP? Is there a clever way to use preg_match for this task?