themaLeecher
http://leecher.themasoftware.com/forum/

Replacements help topic.
http://leecher.themasoftware.com/forum/viewtopic.php?f=4&t=5860
Page 1 of 19

Author:  Freddy [ October 11th, 2013, 1:25 pm ]
Post subject:  Replacements help topic.

Ask any questions about replacements here.

Please post the message text of how you want it to look before and after within code tags.

Author:  alphagamma44 [ November 11th, 2013, 7:25 am ]
Post subject:  Re: Replacements help topic.

i want to replace [url = http :// something . com ]text [ /url ] with http://something.com
how to do that ??

----

also i want to put [ code ] in between imdb link
how to do that

Author:  Freddy [ November 11th, 2013, 7:27 pm ]
Post subject:  Re: Replacements help topic.

Search string:
Code:
\[url=(http://[^\]]+?)\](.*?)\[/url\]

Replace with:
Code:
$1

Enable regex search.

Search string:
Code:
(?i)http://(www\.)?imdb[^>\]'"\s]+

Replace with:
Code:
[code]$0[/code]

Enable regex search.

Author:  sankalp [ January 4th, 2014, 8:22 pm ]
Post subject:  Re: Replacements help topic.

There are many sites which have something like this at the end how to remove or replace it with nothing

The post [ url= http:// www. yoursite . com/ post source] Topic Title [/ url ] appeared first on [url= http :// sitename . com]Site Name[ /url ].

Author:  Freddy [ January 6th, 2014, 12:41 am ]
Post subject:  Re: Replacements help topic.

If that's the last line and it always appear in that website, then just do this: in "WEBSITES" -> "Select that website's page which was added" -> in "Other" tab -> There is a setting to remove last line.

All new leeched message won't have that last line. You could re-leech the existing to quickly remove it as well (Just select all those message and click the re-leech button above the message list).

Author:  Volger [ January 20th, 2014, 12:14 am ]
Post subject:  Re: Replacements help topic.

Hello Freddy,

I need help for some regex.

Before :
Code:
1,2/5 (543)
2,7/5 (1694)
3,6/5 (73)


After :
Code:
1,2/5
2,7/5
3,6/5



Before :
Code:
[b]Taille des fichiers : [/b]1000 Mo + 860 Mo
1000 Mo + 860 Mo


After :
Code:
Taille des fichiers :  x 900 Mo + (1 x  Mo)
 x 900 Mo + (1 x Mo)



Before :
Code:
[b]Nombre de fichiers : [/b]5 Fichiers
[b]Nombre de fichiers :[/b]12 Fichiers


After :
Code:
[b]Nombre de fichiers :[/b] 5
[b]Nombre de fichiers :[/b] 12


Before :
Code:
Machete.Kills.2013.FRENCH.720p.BluRay.x264-CARPEDIEM ( 4860 Mo)


After :
Code:
[b][u]Nom de la release :[/u][/b] [color=red][b]Machete.Kills.2013.FRENCH.720p.BluRay.x264-CARPEDIEM[/b][/color]

Author:  VIPGFX [ January 23rd, 2014, 7:45 am ]
Post subject:  Re: Replacements help topic.

how to change these:
xyz.com.hello.the.world.here.we.go.HTML5-XYZ

to

Hello the world here We go HTML5


ALL_SUB_DES_V4.0.3-Xxs

to

All sub des v4.0.3

Author:  techdaemon [ February 18th, 2014, 10:22 am ]
Post subject:  Re: Replacements help topic.

Does themaleecher's regex support multiple lines of text?

I was hoping you could also include regex options to use like ms word pattern, perl style pattern, unicode pattern and easypattern.

Author:  Freddy [ February 23rd, 2014, 7:50 am ]
Post subject:  Re: Replacements help topic.

techdaemon wrote:
Does themaleecher's regex support multiple lines of text?

I was hoping you could also include regex options to use like ms word pattern, perl style pattern, unicode pattern and easypattern.


Yes, it does support multiline and pretty much everything what regex can support. Check the JAVA regex in google for detailed information. You can add (?s) or (?m) at the start.

Author:  Legenden [ March 26th, 2014, 6:34 pm ]
Post subject:  Re: Replacements help topic.

Freddy wrote:
Search string:
Code:
\[url=(http://[^\]]+?)\](.*?)\[/url\]

Replace with:
Code:
$1

Enable regex search.


When the line you want to replace is two lines, like this example i have here, when the [/url] is on the next line, the replacement thing do not work. How do I do to make it work?
Code:
[url=http://svscomics.com/adult_comics/176878-art-by-glassfish.html][b]Art by Glassfish[/b]
[/url]

Author:  Freddy [ March 26th, 2014, 6:41 pm ]
Post subject:  Re: Replacements help topic.

Update the old to:

Search string:
Code:
(?s)\[(url)=(http://[^\]]+?)\](.*?)\[/\1\]


Replace with:
Code:
$2

Author:  Legenden [ March 26th, 2014, 6:58 pm ]
Post subject:  Re: Replacements help topic.

Freddy wrote:
Update the old to:

Search string:
Code:
(?s)\[(url)=(http://[^\]]+?)\](.*?)\[/\1\]


Replace with:
Code:
$2


Oh, sorry I just saw that the one i quoted was a little dfferent from what I read on the FAQ :P

It is this i mean i wanted to do

Code:
5. You could extract the text from [url=http://something.com]text[/url] like this
Search string: (?i)\[url=http://[^\]]+?](.*?)\[/url\]
Replace with: $1
Enable the "regex search" checkbox.

All the [url=http://something.com]text[/url], would be replaced to just "text".


Tried to just changed it to $2 with that search string but did not work :/

Author:  Freddy [ March 26th, 2014, 7:00 pm ]
Post subject:  Re: Replacements help topic.

Edit: sorry, that one in FAQ is different a lot, but it only will work without new lines.

Use this:

Search string:
Code:
(?is)\[(url)=http://[^\]]+?](.*?)\[/\1\]


Replace with:
Code:
$2

Author:  Legenden [ March 26th, 2014, 7:08 pm ]
Post subject:  Re: Replacements help topic.

Thanks, now it works :)

Author:  Legenden [ March 26th, 2014, 7:51 pm ]
Post subject:  Re: Replacements help topic.

Well, this was annoying :P
When i wanted to delete all svscomics links in the leeched post i did not think about the downoad links that I wante to keep, so that search string repacement thing deleted all links, including download links xD

Is it possible to delete all links to a certain site instead of all links?

Page 1 of 19 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/