Cannot make Some Regex to work (4 posts)

  1. kopoba11
    Posted 4 years ago #

    Hi All,

    I successfully migrated from typepad to wordpress, right now I am in process cleaning up some broken links.

    I put bunch of expressions together some work and some do not, I hope someone can take a look and see if I did anything wrong.

    For example:

    /.m/(.*) => /$1 works but when I try to do the following

    /(d*)/(d*)/(.*)/(.*)/atom.xml =>http://ismashphone.com/comments/feed/
    /(d*)/(d*)/(.*)/(.*)/atom.xml =>/$1/$2/$3.html/comments/feed/

    does not work, I am trying to match the following

    ​/2008​/08​/british​/comments​/rss.xml => ​/2008​/08​/british.html​/comments​/feed/

    same problem with
    /(d*)/(d*)/index.html => /$1/$2/
    trying to match
    /2011/07/index.html => /2011/07/

    Thanks in advance

  2. John Godley
    Plugin Author

    Posted 4 years ago #

    (d*) is not a valid regular expression. I think you mean (\d*)

    You may find this helpful:


  3. kopoba11
    Posted 4 years ago #

    thanks john.

    (\d*) did the trick.

    make sure to fix that code on your main page


    you used it as example

    See code from your site
    < blockquote>
    This pattern tells the plugin that you want to match a URL that looks like:

    </ blockquote>

  4. John Godley
    Plugin Author

    Posted 4 years ago #

    Odd, I don't know how the back slashes disappeared. Thanks for pointing it out

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Redirection
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic