I'm just trying to figure out a regex to find any ampersands that don't immediately precede, and then a space. For example, he will find "asdf & asdf" and "asdf & asdf", but not "asdf and asdf"
This will be used in preg_replace to add spaces before and after. (If you're curious, the problem is that I'm stuck with WYSIWYG, which has an error where it separates spaces from both sides of ampersands, and I need to manually add them back after the fact). Thoughts?
php regex
Mike crettenden
source share