Jump to the post that solved this thread.
Solved: 7 Years, 1 Month, 1 Week ago Mycode for greentext?
#1
Solved: 7 Years, 1 Month, 1 Week ago
Regular expression: (\n|^)>(.*?)(\n|$)

Replacement: $1<span style="color: #4CAF50;">&gt;$2</span>$3

What it does:

Whenever someone writes > it greentexts whatever is after the symbol, as long as it is on a new line

Result:
>hello

Problem:

With the above code, this happens:

>if you greentext
>many lines
>it only makes
>every other
>line green

How do I fix this? I did look for previous threads about this, but no fix for this problem.

Thanks
Reply
#2
Solved: 7 Years, 1 Month, 1 Week ago
Maybe trying non-capturing groups for the newline / start of string and newline / end of string?

Regular expression: (?:\n|^)&gt;(.*?)(?:\n|$)

Replacement: <span style="color: #4CAF50;">&gt;$1</span>

Note that I haven't tried this.
Reply
#3
Solved: 7 Years, 1 Month, 1 Week ago
^ sorry, that doesn't work as required ..

@OP, see also this reply & this reply

YourCode plugin details
if the plugin is used then Multi-line mode needs to be set to yes at Advanced settings of the code (see this image)
Reply
#4
Solved: 7 Years, 1 Month, 1 Week ago
(2017-12-12, 05:17 PM).m. Wrote: ^ sorry, that doesn't work as required ..

@OP, see also this reply & this reply

YourCode plugin details
if the plugin is used then Multi-line mode needs to be set to yes at Advanced settings of the code (see this image)

Sorry, but i have no idea where that is, @.m.

This is what I see:
https://i.imgur.com/mSaB6SM.png
Reply
#5
Solved: 7 Years, 1 Month, 1 Week ago
^ in general, a plugin is needed to fulfill your requirement. suggestion is to install & use YourCode plugin ..
Reply
#6
Solved: 7 Years, 1 Month, 1 Week ago
(2017-12-13, 02:14 AM).m. Wrote: ^ in general, a plugin is needed to fulfill your requirement. suggestion is to install & use YourCode plugin ..

Thank you, I´ll try.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)