WordPress Redirection Plugin case insensitive regular expression WordPress Redirection Plugin case insensitive regular expression wordpress wordpress

WordPress Redirection Plugin case insensitive regular expression


Let me explain what each of your attempts mean:

  • (?:^|\W)someword(?:$|\W) - either the start of the string or one non-word character, followed by someword, followed by the end of the string or a non-word character
  • ^/(\b\Wsomeword\W\b) - the start of the string, forward slash, followed by a word boundary, followed by a non-word character (you already have a contradiction here), followed by someword, followed by a non-word character, followed by a word boundary
  • ^/(\W\bsomeword\b\W) - same with non-word characters and word boundaries switched
  • ^/(?i\bsomeword\b) start of string, followed by forward slash, followed by ?!
  • /(\bS|sO|oM|mE|eW|wO|oR|rD|d\b) - forward slash, followed by either a word boundary and S or sO or oM or mE or eW or wO or oR or rD or d and a word boundary

Word character - either an English letter, a digit or underscore.

Word boundary - a place where on one side you have a word character and on the other, something, which is not a word character.


Now as for a solution:

(?i)\/someword$

Meaning case insensitive, there is a slash and someword, followed by the end of the string.