anyone good at regex ? help needed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cooldude7
    Confirmed User
    • Nov 2009
    • 4306

    #1

    anyone good at regex ? help needed.

    i have word press site,
    it has links in each post in following pattern.


    http://jump2link.net/watch/getdownloadmanager.php?movie=Sculpture%20(2009)%20 &authid=1321

    http://jump2link.net/watch/getdownloadmanager.php?movie=Dreams%20and%20Shadow s%20(2009)%20&authid=1321

    so i want to replace all these links using "search regex" plugin.

    i neeed help in generating regex pattern so that all links will get searched by this plugin and i can replace them.

    thanks for your time.
    Last edited by cooldude7; 03-07-2011, 09:47 PM.
  • cooldude7
    Confirmed User
    • Nov 2009
    • 4306

    #2
    as u can see the

    http://jump2link.net/watch/getdownloadmanager.php?movie=

    this part is constant in each url and later on the movie name which is random in each post.

    Comment

    • Antonio
      Too lazy to set a custom title
      • Oct 2001
      • 14136

      #3
      if I have to take a (very) wild guess here, you should be able to do that in MySQL without having to mess with regex at all

      there should be a query that finds "http://jump2link.net/watch/getdownloadmanager.php?movie=" in your links and then you can replace them with other entries?????

      or a few lines of PHP???

      Comment

      • cooldude7
        Confirmed User
        • Nov 2009
        • 4306

        #4
        Originally posted by Antonio
        if I have to take a (very) wild guess here, you should be able to do that in MySQL without having to mess with regex at all

        there should be a query that finds "http://jump2link.net/watch/getdownloadmanager.php?movie=" in your links and then you can replace them with other entries?????

        or a few lines of PHP???
        thanks for your reply, i m looking for it now.

        Comment

        • cooldude7
          Confirmed User
          • Nov 2009
          • 4306

          #5
          i got it,

          search for
          /getdownloadmanager.php\?([^\"]*)\">/iU

          i.e.

          # starts with: getdownloadmanager.php?
          # a series of characters up to, but not including, the next double-quote (") - 1st capture
          # the string: ">

          Comment

          • HarryMuff
            Confirmed User
            • Dec 2005
            • 271

            #6
            Dunno if this will work i just typed it in here havn't tested.

            Code:
            /^(http:\/\/jump2link.net\/watch\/getdownloadmanager.php?movie=){1}.+(1321){1}$/

            Comment

            Working...