Title: RegEx gets modified when saving
Last modified: August 14, 2017

---

# RegEx gets modified when saving

 *  Resolved [Daniel Zimmermann](https://wordpress.org/support/users/optimiertes/)
 * (@optimiertes)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/regex-gets-modified-when-saving/)
 * I would like to use following expression to redirect URLs containing Parameters,
   Hashtags or concluding with a Slash character.
    `^/old-page(/|((\#|\?|\/\?|\/\#).*))?
   $` however, when saving the above expression it appears like this `^/old-page(/
   |((\`
 * Plugin Version 2.7.1
    -  This topic was modified 8 years, 10 months ago by [Daniel Zimmermann](https://wordpress.org/support/users/optimiertes/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/regex-gets-modified-when-saving/#post-9410252)
 * It’s probably being sanitized away. I will look into this, but bear in mind that
   a hash makes no sense in a source URL as it is not sent to the server and therefore
   is not something you can use in a redirect. You can only use them in the target.
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/regex-gets-modified-when-saving/#post-9411865)
 * In 2.7.2 it won’t modify the URL if a # is present, but as mentioned above, it’s
   not possible to use these in the source URL anyway.
 *  Thread Starter [Daniel Zimmermann](https://wordpress.org/support/users/optimiertes/)
 * (@optimiertes)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/regex-gets-modified-when-saving/#post-9413998)
 * Thank you for mentioning the # and the update!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘RegEx gets modified when saving’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Daniel Zimmermann](https://wordpress.org/support/users/optimiertes/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/regex-gets-modified-when-saving/#post-9413998)
 * Status: resolved