Title: Regex101.com code not working
Last modified: July 26, 2022

---

# Regex101.com code not working

 *  Resolved [wentevineyards](https://wordpress.org/support/users/wentevineyards/)
 * (@wentevineyards)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/regex101-com-code-not-working/)
 * Hey all,
 * I inadvertently sent out an email with an incorrect link as a CTA.
 * I am trying to add a Regex redirect that detects a param/value pair in the URL
   and redirects only if it sees that. If someone goes to the page without the param/
   value pair, they should simply stay on that page.
    [https://regex101.com/r/BsV2P4/1](https://regex101.com/r/BsV2P4/1)
 * Our email hyperlinks inks contain “utm_campaign=Wente%20Events”
 * Normal URL: [https://wentevineyards.com/journal/events/petty-theft](https://wentevineyards.com/journal/events/petty-theft)
   
   Email URL: [https://wentevineyards.com/journal/events/petty-theft?utm_campaign=Wente%20Events](https://wentevineyards.com/journal/events/petty-theft?utm_campaign=Wente%20Events)(
   and more param/value pairs after that)
 * Regex101.com says this matches the email URL but not Normal URL (that is what
   we want)
    /^https:\/\/wentevineyards\.com\/journal\/events\/petty-theft\?utm_campaign
   =Wente%20Events\.*
 * But it isn’t working. Help!!!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fregex101-com-code-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/regex101-com-code-not-working/#post-15861665)
 * The support page for this is here:
 * [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
 * You need to match the path, not the domain.
 *  Thread Starter [wentevineyards](https://wordpress.org/support/users/wentevineyards/)
 * (@wentevineyards)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/regex101-com-code-not-working/#post-15861693)
 * Thanks, John.
 * I get what you are saying but when I do that I’m getting a message that wentevineyards.
   com redirected you too many times. To fix this issue, try clearing your cookies.
   ERR_TOO_MANY_REDIRECTS
 * Updated Regex101.com test
    [https://regex101.com/r/Mz8jOO/1](https://regex101.com/r/Mz8jOO/1)
 * In the WordPress plugin tool.
    Source: ^\/journal\/events\/petty-theft\?utm_campaign
   =Wente Events\.* Destination: ^\/journal\/events\/journey-revisited\?utm_campaign
   =Wente%20Events%20Redirect
 * Sample URL: [https://wentevineyards.com/journal/events/petty-theft?utm_campaign=Wente%20Events&utm_medium=email&_hsmi=220877473&_hsenc=p2ANqtz-9CzOLab2-Bf294Uydp_MnTY3i4wlfgcYYdazU93OrLu85b3y5EfzHMTUUAO2iM5_qVGa9KhbuPUaLroRKQd-kWl-tK8Mcc6u5g_tN9Svu6ziSPQvY&utm_content=220877473&utm_source=hs_email](https://wentevineyards.com/journal/events/petty-theft?utm_campaign=Wente%20Events&utm_medium=email&_hsmi=220877473&_hsenc=p2ANqtz-9CzOLab2-Bf294Uydp_MnTY3i4wlfgcYYdazU93OrLu85b3y5EfzHMTUUAO2iM5_qVGa9KhbuPUaLroRKQd-kWl-tK8Mcc6u5g_tN9Svu6ziSPQvY&utm_content=220877473&utm_source=hs_email)
 *  Thread Starter [wentevineyards](https://wordpress.org/support/users/wentevineyards/)
 * (@wentevineyards)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/regex101-com-code-not-working/#post-15861732)
 * Hey John,
 * Figured out my issue. Just had to remove my starting carrot (removed the %20 
   space too just to be safe).
 * Source: \/journal\/events\/petty-theft\?utm_campaign=Wente\.*
    Destination: \/
   journal\/events\/journey-revisited\?utm_campaign=Wente
 * Working fine now. Thanks again!
 *  Thread Starter [wentevineyards](https://wordpress.org/support/users/wentevineyards/)
 * (@wentevineyards)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/regex101-com-code-not-working/#post-15861733)
 * Resolved!

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

The topic ‘Regex101.com code not working’ 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/)

## Tags

 * [regular expression](https://wordpress.org/support/topic-tag/regular-expression/)

 * 4 replies
 * 2 participants
 * Last reply from: [wentevineyards](https://wordpress.org/support/users/wentevineyards/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/regex101-com-code-not-working/#post-15861733)
 * Status: resolved