#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Simple url regex question


    I need to find all of the occurrences of websiteurldotcom/wiki/index.php?title=Glossary as well as websiteurldotcom/wiki/index.php?title=Glossary#Underwriting and a lot of other varying terms after the #.
    I just need to find them ALL and replace them with websiteurldotcom/blog/glossary

    What would be the best regex for the "find" field in my find and replace?

    Thanks!
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,112
    Rep Power
    9398
    Well, the only "expression" part would be the URL fragment/anchor.
    Code:
    websiteurl\.com/wiki/index\.php\?title=Glossary(#[\w.-]+)
    as a start. Kinda depends on what stuff shows up after the # so I took a guess at letters, numbers, underscores, periods, and hyphens.

IMN logo majestic logo threadwatch logo seochat tools logo