I was intrigued as to how the WordPress Search feature worked and thought I would do some investigating. In doing so I’ve stumbled across this interesting quirk. It’s very easy to replicate.
So a search on WordPress.com for “wordpress search“. You will get an interesting result.
Every result that contains the word wordpress will have search-excerpt”>Wordpress substituted in it’s place.
In fact, you can do any search on WordPress Search of the form <word> search and this particular behavior will show.
I’m guessing there is some form of regular expression mangling going on here but am not quite sure what it is. If anyone has any ideas I’d love to hear them. Please leave a comment.