I just want to stress that I've been reading, trying and failing a lot before I asked this question. I can see similar questions but not exact duplicates.
I need to find a value that:
- Could be in any case.
- Could or could not end with something completely random E.g. "Cake is yummy"
- May or may not be enclosed in /slashes/
This is what I'm currently doing:
if ( $name == '/cake/' || $name == '/CAKE/' || $name == '/Cake/' || $name == '/CaKe/' || $name == 'CAKE' || $name == 'cake' {
This is what I'm trying to do:
if(preg_match == (cake:) *(\([a-zA-Z]+\).+){
Can't quite get it to work.