Support » Plugin: Redirection » [Plugin: Redirection] What is wrong w/ this regular expression?

  • I have about 3100 zip codes to enter into redirection so that when someone searches a zip code on my site it does a pass through to a designated URL on the site.

    However, zip codes have a similar pattern and I want to use regular expression to complete this task. Basically, instead of entering 28553, 28554, 28555, 28556, 28557, 28558 manually, I want to do it with regular expression.

    Right now I have as my source /?s=2855[3 4 5 6 7 8] and my target a URL on the site. I even did /?s=2855[3 4 5 6 7 8]$ However, both just take me nowhere and reloads the current page. I also tried /?s=2855* hoping to get everything from 28550-28559 but this too just reloads the current page and I don’t even get the usual WordPress “sorry, no posts found for this search term”

    What am I missing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Godley


    The examples you gave above are not valid regular expressions. There is a lot of information on various websites such as, although I appreciate it may seem daunting.

    If you use \d this will match a number. Note that you will need to escape regular expression characters so something like: /\?=2855\d should match 28550-28559

    Also make sure you have the regex checkbox enabled.

    Question… what type of RegEx does Redirection use. Is it Posix or something else?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Redirection] What is wrong w/ this regular expression?’ is closed to new replies.