+ Reply to Thread
Results 1 to 4 of 4

Thread: regex anybody ?

  1. #1
    Elite
    DarkSaibot v.1.3.10's Avatar
    Join Date
    15.11.08
    Location
    Black Flag
    P2P Client
    Anonymous
    Posts
    1,758
    Activity Longevity
    2/20 18/20
    Today Posts
    0/5 sssss1758

    regex anybody ?

    hello boys & girls
    anybody is good with regex commands to help me & "save me eyes" from individually work

    i wanted to bulk remove all links from a specific domain in my website from all posts & made a mistake with no backup for it
    i used search and replace plugin to remove the specific domain but the stupid me typed only the domain with no sintax so i have left from for example
    Code:
    https://google.com/JQ92VZeL.html
    with <a href="JQ92VZeL">JQ92VZeL</a> on all links

    it's any syntax to bulk remove the second part from the links considering that those numbers left are random for ex
    from
    Code:
    https://google.com/JQ92VZeL.html
    left with
    Code:
    JQ92VZeL.html
    Code:
    https://google.com/JQ93V555.html
    left with
    Code:
    /JQ93V555.html
    and so on

    without deleting from each post manually
    Reply With QuoteReply With Quote
    Thanks

  2. #2
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    39,439
    Activity Longevity
    8/20 19/20
    Today Posts
    1/5 ssss39439
    As a general rule, you should never parse or manipulate HTML using regexps. But let's ignore that and try to salvage this situation. I don't understand exactly what you need to remove, though...

    <a href="JQ92VZeL">JQ92VZeL</a>
    These would be matched by \<a href\=\"[a-zA-Z0-9]{8}\"\>[a-zA-Z0-9]{8}\<\/a\>

    /JQ93V555.html
    These would be matched by \/[a-zA-Z0-9]{8}\.html

    In principle, replace all matches for whichever of the above applies with nothing. The expressions may need tweaking depending on the possible lengths and characters of these random strings. Try everything on an offline copy first.
    "I just remembered something that happened a long time ago."
    Reply With QuoteReply With Quote
    Thanks

  3. Who Said Thanks:

    DarkSaibot v.1.3.10 (07.11.23) , Instab (07.11.23)

  4. #3
    Elite
    DarkSaibot v.1.3.10's Avatar
    Join Date
    15.11.08
    Location
    Black Flag
    P2P Client
    Anonymous
    Posts
    1,758
    Activity Longevity
    2/20 18/20
    Today Posts
    0/5 sssss1758
    DRY RUN: 170 tables were searched, 0 cells were found that need to be updated, and 0 changes were made.
    it can't find the links like the first time when i have tried

    I don't understand exactly what you need to remove, though...
    let's take for example a filehost like uploaded.net

    when you post links for download in your wordpress or forum links are as follow

    what i did by mistake was putting only the uploaded.net in command do be bulk deleted
    so i I am left with the last part of the links,(the part without the domain name) which is different
    snvursmtf74p , 2jxOGGlq,Hypnography that part i want to bulk delete from all post if it's posible
    Reply With QuoteReply With Quote
    Thanks

  5. #4
    Moderator anon's Avatar
    Join Date
    01.02.08
    Posts
    39,439
    Activity Longevity
    8/20 19/20
    Today Posts
    1/5 ssss39439
    snvursmtf74p
    [a-z0-9]{12}

    2jxOGGlq
    [a-zA-Z0-9]{8}

    Hypnography.rar.html
    .*\.[a-z]{3}\.html$

    For all of these, you can add \/ at the beginning to match leading slashes. If you send me a PM with some more specific examples of what you need to replace as shown in your editor, we can determine if the expressions need further tweaking.
    "I just remembered something that happened a long time ago."
    Reply With QuoteReply With Quote
    Thanks

  6. Who Said Thanks:


+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •