| View previous topic :: View next topic |
| Author |
Message |
sosek
Joined: 20 Jun 2012 Posts: 1 Location: Wrocław, Poland
|
Posted: Wed Jun 20, 2012 4:03 pm Post subject: Highlighting only a word from a line. |
|
|
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 |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Thu Jun 21, 2012 4:44 pm Post subject: |
|
|
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 |
|
 |
Pedwiddle
Joined: 31 May 2012 Posts: 8
|
Posted: Fri Jun 29, 2012 6:49 am Post subject: |
|
|
iirc, the P1 variable is equivalent to %1 - it's the first matched pattern.
Hope this helps... |
|
| Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3274
|
Posted: Fri Jun 29, 2012 3:52 pm Post subject: |
|
|
| Not really, you'll have to give a more specific example. |
|
| Back to top |
|
 |
|