php - Matching a nonquoted string -


i'm trying work regexes in php on school's news site (running wordpress). idea is, whenever saves post, instances of "regis" (without 'jesuit' @ end) replaced "regis jesuit." (i go regis jesuit high school, , they're picky branding). overall works fine following case-insensitive regex:

/regis(?! jesuit)/i 

how modify regex doesn't match if finds string "regis" or 'regis' (in single or double quotes)? (or "i go regis high school" quoted well)? idea here change necessary, keep same in direct quotes in people's stories don't change people's quotes.

thanks! morgan

based on comments question, perhaps solution stick current regex, use client-side javascript warning only.

so, if text entered matches "regis" not followed " jesuit" before user submits displays message saying "make sure you've correctly branded us", doesn't automatically change - leaving language complexity stuff brain of human can (hopefully) understand it. :)


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -