regex always gives me trouble, and I'm trying to get my mind better wrapped around it.
I am trying to figure out how to find a peice of text sandwiched between 2 partially known ends. The string looks like this:
33###text_to_find|||42
the numbers at the beginning and end are variable, and they can be any length. eg:
3###text_to_find|||42
32###text_to_find|||425
etc.
I thought this would work, but obviously it doesn't:
$string = "32###text_to_find|||425";
preg_match("/([0-9]+#{3})(|{3}[0-9]+)$/", $string, $matches);
echo($eh[0]);
Also, what is the point of the / before and after the regex expression. I've seen it done both ways, but I get an error if I try it without them.
TIA