I have content like the following that I need to run a preg_replace on:
Test Title|
test content
John's title - has a hyphen|
john's content
Last one... I promise|
last content
I am using the following preg_replace regex on the content to get all the lines ending in "|" and wrapping it with an tag.
preg_replace("/([a-zA-Z][a-zA-Z-'\,-\d\s\w]+\|)/", '<h3 id="${1}">${1}</h3>', $content);
The problem I am having is that the regex is not grabbing the hyphen or ellipses. I have inherited this code from another developer so i am more than willing to trash it and start over, but wanted to try to make it work if I could.