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
Post a Comment