if (ereg('abc.+abc$', 'abc123')) {
echo "Match found.";
} else {
echo "No match found.";
}
This will match anything string that begins with abc, ends with abc, and has something inbetween. (i.e. "abc123abc" or "abc abc" but not "abcabc")
Hope this helps.