themaPoster
http://poster.themasoftware.com/forum/

Forum replacements problems.
http://poster.themasoftware.com/forum/viewtopic.php?f=4&t=634
Page 36 of 74

Author:  Freedom35 [ March 23rd, 2017, 12:07 pm ]
Post subject:  Re: Forum replacements problems.

Hey Freddy I need another help from you since it it to complicated for me :

Before
Code:
[center][b][size=3][color=lightseagreen]The title of the subject that will differ[/color][/b][/size]


After
Code:
<subject>The title of the subject that will differ</subject>
[center][b][size=3][color=lightseagreen]The title of the subject that will differ[/color][/b][/size]


I don't even know if it's possible but I belive in your regex skills :)

Thanks

Author:  Freddy [ March 23rd, 2017, 12:49 pm ]
Post subject:  Re: Forum replacements problems.

The <subject> element can only be used in .txt file and is parsed when loading posts from .txt file.

It won't work if you add it via replacement when it's being posted. It will just get posted in forum with that line as message text.

Author:  Freedom35 [ March 23rd, 2017, 1:44 pm ]
Post subject:  Re: Forum replacements problems.

Yeah I know but I need that for something else:
I have posts from ThemaManager with weird titles and I wan't them to be posted on different forum but when I'm saving them I don't have desirable name, so I thought I will first delete <subject> tag from those posts using regex and then I'll create my own <subject> from the title I posted above and then drop those to ThemaPoster and use my new name.

I hope I've explained myself well

btw Those regex replacments will be done in ThemaLeecher

Author:  Freddy [ March 23rd, 2017, 8:11 pm ]
Post subject:  Re: Forum replacements problems.

Search for:
Code:
\[center\]\[b\]\[size=3\]\[color=lightseagreen\](.+?)\[/color\]\[/b\]\[/size\]


Replace with:
Code:
<subject>$1</subject>\n$0


Enable regex search.

You can use themaLeecher forum next time: http://leecher.freddy.lt/forum/viewtopic.php?f=4&t=5860

Author:  Freedom35 [ March 23rd, 2017, 8:51 pm ]
Post subject:  Re: Forum replacements problems.

Thank You Freddy, I rly appreciate it

Author:  bestfreeclip [ April 1st, 2017, 10:12 am ]
Post subject:  Image links modification.

Dear Freddy,

How can i change this automatically on themaposter? i cant change manually for only one forum. so i need to understand how i can apply replace codes for this change.

Original version:
Code:
[url=http://imagetwist.com/j4461gbvvyrc/1E3B27E.jpg][img]http://img162.imagetwist.com/th/14853/j4461gbvvyrc.jpg[/img][/url]


i want to post only this part for the pictures. how can i get only this part.

Code:
[img]http://img162.imagetwist.com/th/14853/j4461gbvvyrc.jpg[/img]

Author:  Biddan [ April 1st, 2017, 9:30 pm ]
Post subject:  Re: Forum replacements problems.

Hi, freddy.
Can you make this

Code:
[url=http://imagetwist.com/uo28dmcrlrfu/kittens_thesauceftw_vid_01.jpeg][img]http://img66.imagetwist.com/th/14792/uo28dmcrlrfu.jpg[/img][/url]


look like this?

Code:
[img]http://imagetwist.com/uo28dmcrlrfu/kittens_thesauceftw_vid_01.jpeg[/img]

thx!

EDIT:
Already figured it out!
Leaving the answer if anyone needs it in the future

Search for:
Code:
\[URL=(.+?)\].+?\[/URL\]


Replace with:
Code:
[img]$1[/img]

Author:  Freddy [ April 2nd, 2017, 5:26 am ]
Post subject:  Re: Forum replacements problems.

"URL" should be lowercase if it's lowercase in the message, otherwise it won't work.

That replacement will also affect all links in that format (even not imagetwist).

Author:  Freddy [ April 2nd, 2017, 5:59 am ]
Post subject:  Re: Image links modification.

@bestfreeclip

You would need to add replacement:

Search for:
Code:
\[url=.+?\](\[img\].+?\[/img\])\[/url\]


Replace with:
Code:
$1


Enable regex search.

Author:  Biddan [ April 13th, 2017, 10:03 pm ]
Post subject:  Re: Forum replacements problems.

Wondering if this can be done with regex

I have this:

Code:
[URL=http://imagetwist.com/d6a2d645cp0e/puddens_359mb_856x480_15.51.jpeg][IMG]http://img162.imagetwist.com/th/15120/d6a2d645cp0e.jpg[/IMG][/URL]
[URL=http://imagetwist.com/mzttacgvxboj/puddens_359mb_856x480_15.51__2_.jpeg][IMG]http://img162.imagetwist.com/th/15120/mzttacgvxboj.jpg[/IMG][/URL]

[img]http://i.imgur.com/27fQZF4.png[/img]
[size="10"][b]Size[/b]: SIZE ||  [b]Quality[/b]: QUAL
[b]Time[/b]: TIME || [b]Format[/b]: FORMAT[/size]

[img]http://i.imgur.com/DoQOhI5.png[/img]
[url=http://k2s.cc/file/54c8cee388a5c/puddens_359mb_856x480_15.51.mp4]

[img]https://i.imgur.com/HTu8whp.png[/img]
LINK2

[img]http://i.imgur.com/ijd57dI.png[/img]
LINK3


& i want regex to copy the size, resolution, time and format from the link url
Code:
puddens_359mb_856x480_15.51.mp4

and replace it with SIZE, QUAL, TIME, FORMAT

example:

Code:
[URL=http://imagetwist.com/d6a2d645cp0e/puddens_359mb_856x480_15.51.jpeg][IMG]http://img162.imagetwist.com/th/15120/d6a2d645cp0e.jpg[/IMG][/URL]
[URL=http://imagetwist.com/mzttacgvxboj/puddens_359mb_856x480_15.51__2_.jpeg][IMG]http://img162.imagetwist.com/th/15120/mzttacgvxboj.jpg[/IMG][/URL]

[img]http://i.imgur.com/27fQZF4.png[/img]
[size="10"][b]Size[/b]: 359mb ||  [b]Quality[/b]: 856x480
[b]Time[/b]: 00:15:51 || [b]Format[/b]: mp4[/size]

[img]http://i.imgur.com/DoQOhI5.png[/img]
[url=http://k2s.cc/file/54c8cee388a5c/puddens_359mb_856x480_15.51.mp4]

[img]https://i.imgur.com/HTu8whp.png[/img]
LINK2

[img]http://i.imgur.com/ijd57dI.png[/img]
LINK3


Thanks!

Author:  Freddy [ April 16th, 2017, 6:18 am ]
Post subject:  Re: Forum replacements problems.

Search for:
Code:
\[size=\"10\"]\[b]Size\[/b]: SIZE \|\|  \[b]Quality\[/b]: QUAL\s*\[b]Time\[/b]: TIME \|\| \[b]Format\[/b]: FORMAT\[/size](\s*.+\n\[url=http://k2s.+?([0-9]+mb)_([0-9]+x[0-9]+)_([0-9]+\.[0-9]+)\.(.+?)\])


Replace with:
Code:
[size="10"][b]Size[/b]: $2 ||  [b]Quality[/b]: $3 [b]Time[/b]: $4 || [b]Format[/b]: $5 [/size]$1


Enable regex search.

But the structure should be the same.

Author:  vandt [ June 4th, 2017, 4:30 am ]
Post subject:  Re: Forum replacements problems.

Example Before:
Code:
[url=https://music.israbox.com/engine/go.php?url=aHR0cDovL3R1cmJvYml0Lm5ldC82dWFqMGY2anJ1dWkuaHRtbA%3D%3D][b]2017 - Race To Zero FLAC.rar[/b][/url]

After:
Code:
https://music.israbox.com/engine/go.php?url=aHR0cDovL3R1cmJvYml0Lm5ldC82dWFqMGY2anJ1dWkuaHRtbA%3D%3D

Author:  Freddy [ June 11th, 2017, 6:18 am ]
Post subject:  Re: Forum replacements problems.

Search for:
Code:
\[url=(https://music\.israbox.+?)\].+?\[/url\]


Replace with:
Code:
$1


Enable regex search.

Author:  DragonflyDragon [ June 13th, 2017, 2:33 pm ]
Post subject:  Re: Forum replacements problems.

Hello Freddy,

How to delete all content in text file AFTER some string, including that string as well?
And similar but I think harder, how to delete all content in text file BEFORE some string, including that string as well?

For example,
Before:
Code:
Some content 1 which is unimportant
.
.
.
string1
Some content 2 which is important to stay
.
.
.
string2
Some content 3 which is unimportant
.
.
.


After:
Code:
Some content 2 which is important to stay
.
.
.

Author:  DragonflyDragon [ June 13th, 2017, 2:39 pm ]
Post subject:  Re: Forum replacements problems.

And one more question,

Is it possible to find string1 and replace it with string2?

For example,
Before:
Code:
Some content
.
.
.
string1
.
.
.
Sometext1: string2

After:
Code:
Some content
.
.
.
string2
.
.
.
Sometext1:

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