Re: macro to highlight text in carrots
- From: "Klaus Linke" <info@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Sep 2007 02:09:21 +0200
"jkmar5" wrote:
Is there a macro that I could use to highlight text in carrots? I would
like
the dark gray highlighting color.
For example, here is a section of the document.
<question>
<quest>Having a good attitude about school and work and feeling good about
what you achieve.</quest>
<answer>career wellness</answer>
</question>
I need everything inside the carrots to be highlighted dark gray.
In your example, it would be easiest to highlight everything, and then
remove the highlight from the tags with a wildcard replacement:
Edit > Replace, check "Match wildcards",
Find what: \<*\>
Replace with: ((go to Format > Style > Default Paragraph Font))
\< matches "<", \> matches ">", * matches anything else in between.
If you just want to highlight the innermost tags, you could use a more
advanced wildcard replacement:
Find what: \<([!/\<\>]@\>)[!\<\>]@\</\1
Replace with: ((choose some formatting such as Highlight))
Then with the first wildcard replacement given above, remove the manual
formatting from the tags.
[!/\<\>] matches any character except a slash or angle bracket, [!/\<\>]@
matches any number of them.
\<([!/\<\>]@\>) matches any starting tag such as "<quest>". To reuse a
wildcard expression, you can put brackets around it.
You can reuse the first bracketed expression using the wildcard \1.
So in the example, ([!\<\>]@\>) would match "quest>", and \</\1 would match
"</quest>".
[!\<\>]@ makes sure that the text in between the starting and closing tags
don't contain other tags.
Regards,
Klaus
.
- Prev by Date: Re: How to link to a field in a tabel from a header? Programming or?
- Next by Date: Re: macro to highlight text in carrots
- Previous by thread: Re: How to link to a field in a tabel from a header? Programming or?
- Next by thread: Re: macro to highlight text in carrots
- Index(es):
Relevant Pages
|