Title: Regex example
Last modified: July 7, 2022

---

# Regex example

 *  Resolved [mstudioIL](https://wordpress.org/support/users/mstudioil/)
 * (@mstudioil)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/regex-example-3/)
 * I look at:
    [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
   and not sure I understand it, what I need to under in the source and in the target
   I have site with lots of redirections to do and want to avoid doing them one 
   by one. Can you tell me if this is right? this is for the source `https:\/\/site-
   name\.com\/en\/laboratory-testing-equipment-for-development-and-electronics\/
   oscilloscopes\/(.*)\/` and this is for the target `https:\/\/site-name.com\/test-
   eqipment\/electronics\/spectrum-analyzers\/(.*)\/`

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

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/regex-example-3/#post-15805428)
 * You do not need to match the domain – just the path. You also do not need to 
   escape `/` – `/` is fine instead of `\/`
 *  Thread Starter [mstudioIL](https://wordpress.org/support/users/mstudioil/)
 * (@mstudioil)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/regex-example-3/#post-15805450)
 * Thanks, so I need to change the old string to new string or each pages I want
   to change?
    `en/laboratory-testing-equipment-for-development-and-electronics/
   spectrum-analyzers/(.*)/` for source and `test-eqipment/electronics/spectrum-
   analyzers/(.*)/` for target will work? (I did mistake on the first post.)
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/regex-example-3/#post-15805655)
 * You will need to include the first `/` as that is part of the path.
 * No, the target does not contain regular expressions – it should be the result
   of expression – `$1`. See [https://redirection.me/support/redirect-regular-expressions/](https://redirection.me/support/redirect-regular-expressions/)
   for more details and examples.
 *  Thread Starter [mstudioIL](https://wordpress.org/support/users/mstudioil/)
 * (@mstudioil)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/regex-example-3/#post-15805945)
 * Thanks, I will test it

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

The topic ‘Regex example’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [mstudioIL](https://wordpress.org/support/users/mstudioil/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/regex-example-3/#post-15805945)
 * Status: resolved