TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Highlighting only a word from a line.

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
sosek



Joined: 20 Jun 2012
Posts: 1
Location: Wrocław, Poland

PostPosted: Wed Jun 20, 2012 4:03 pm    Post subject: Highlighting only a word from a line. Reply with quote

I am considering moving from TF, but I haven't found a way to do such thing:
I would like to highlight only certain words if they are followed by given characters like white space. In this case, I would like to hilite only the halfling word.
Code:
 Wittich Opennheim, halfling.


In tinyfugue I can do it by a regexp with such pattern:
Code:
, (ogr|ogrzyca|mezczyzna|kobieta|elf|elfka|krasnolud|krasnoludka|halfling|halflinka|niziolek|niziolka|gnom|gnomka|mutant|mutantk|polelf|polelfka)( |\\.|,)


And the usage of special variable P1. Is there a way to do it in tintin?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Thu Jun 21, 2012 4:44 pm    Post subject: Reply with quote

TinTin++ handles regular expressions at a higher level, and you can insert a full regular expression by enclosing the statement in curly brackets, paranthesis is automatically added, so that'd be:
Code:
, {ogr|ogrzyca|mezczyzna|kobieta|elf|elfka|krasnolud|krasnoludka|halfling|halflinka|niziolek|niziolka|gnom|gnomka|mutant|mutantk|polelf|polelfka}{ |\\.|,}


Or alternatively using the word boundary option:
Code:
, {ogr|ogrzyca|mezczyzna|kobieta|elf|elfka|krasnolud|krasnoludka|halfling|halflinka|niziolek|niziolka|gnom|gnomka|mutant|mutantk|polelf|polelfka}{\b}


I have no idea what the P1 variable is in Tinyfugue.
Back to top
View user's profile Send private message Send e-mail
Pedwiddle



Joined: 31 May 2012
Posts: 8

PostPosted: Fri Jun 29, 2012 6:49 am    Post subject: Reply with quote

iirc, the P1 variable is equivalent to %1 - it's the first matched pattern.

Hope this helps...
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Fri Jun 29, 2012 3:52 pm    Post subject: Reply with quote

Not really, you'll have to give a more specific example.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group