Support » Plugin: Redirection » Cannot make Some Regex to work

  • kopoba11

    (@kopoba11)


    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/
    or
    /(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

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

    (@johnny5)

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

    You may find this helpful:

    http://www.regular-expressions.info/

    kopoba11

    (@kopoba11)

    thanks john.

    (\d*) did the trick.

    make sure to fix that code on your main page

    Redirection

    you used it as example

    See code from your site
    < blockquote>
    /(d*)/(d*)/(.*)
    This pattern tells the plugin that you want to match a URL that looks like:

    /2007/05/some-url/
    </ blockquote>

    Plugin Author John Godley

    (@johnny5)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot make Some Regex to work’ is closed to new replies.