• Hi, I’m hoping to do a regex that ignores case but Redirection doesn’t seem to allow for regex flags. For example, I want to redirect .pdf files that contain the string “bod” in it. I’ve gotten it to work on sample file names with a lowercase match when the redirect is set to:

    /(.*bod?.*\.pdf)

    But when I try to specify the regex flag to ignore case, which comes after the closing “/” in the regex, the match doesn’t seem to take:

    /(/*bod?.*\.pdf/i)

    A working example can be found here: https://regexr.com/3djf9

    Is there a way to specify regex flags in Redirection when using Regular Expressions in the URL?

    https://www.ads-software.com/plugins/redirection/

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

    (@johnny5)

    It’s not currently possible, no.

    Hi John,

    First off–thank you very much for this excellent plug-in–I rely on it daily and I’m a huge fan.

    I would like to add my +1 for supporting flags when checking the regex box.

    If I could also ask a huge favor; could you update your documentation to explicitly note that flags are not supported ATM in this use case? I was really confused by this as your documentation says to consult a regex website, so I did, and had my regex correct according to the site; then, naturally, was beating my head against a wall trying to figure out what I was doing wrong when it didn’t work using the plugin! ??

    Thanks again for such a great plug-in; it really is excellent!

    Best,
    Micah

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Regex Flags in Redirection’ is closed to new replies.