Let me preface this by saying that I suck at regex badly, I've maybe used it 4-5 times in my life.
Let's assume I have the following array:
$array = array(
1 => 'ReactorCraft:reactorcraft_block_modelreactor',
2 => 'f5b2289c-c1aa-4498-9673-271be0aada6c',
3 => 'A word'
)
I want to perform a preg_match
on each element(already taken care of) with a pattern that will match ReactorCraft
, and only that, followed by whatever, I don't particularly care what comes next, I'm only interested in the word ReactorCraft
.
I've tried a very simple, and probably wrong, pattern:
'/[^ReactorCraft*]/i'
'/[\\bReactorCraft\\b]/i'
And that's about all my knowledge when it comes to regex.
Any nudging in the right direction is more than appreciated.