PageRenderTime 27ms CodeModel.GetById 11ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/users-guide/mode-rule-seq-regexp.html

#
HTML | 26 lines | 26 code | 0 blank | 0 comment | 0 complexity | 7db03d2c3d9e0b54900fbcc349ef19e5 MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The SEQ_REGEXP Tag</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="writing-modes.html" title="Chapter 10. Mode Definition Syntax"><link rel="prev" href="mode-rule-seq.html" title="The SEQ Tag"><link rel="next" href="mode-rule-import.html" title="The IMPORT Tag"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The SEQ_REGEXP Tag</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mode-rule-seq.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Mode Definition Syntax</th><td width="20%" align="right"> <a accesskey="n" href="mode-rule-import.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="mode-rule-seq-regexp"></a>The SEQ_REGEXP Tag</h2></div></div></div><p>The <code class="literal">SEQ_REGEXP</code> rule is similar to the
 2        <code class="literal">SEQ</code> rule except the match sequence is taken to be a
 3        regular expression. In addition to the attributes supported by the
 4        <code class="literal">SEQ</code> tag, the following attributes are
 5        supported:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">HASH_CHAR</code> - a literal string which must
 6                be at the start of a regular expression.</p></li><li><p><code class="literal">HASH_CHARS</code> - a list of possible literal
 7                characters, one of which must match at the start of the regular
 8                expression.</p></li></ul></div><p><code class="literal">HASH_CHAR</code> and <code class="literal">HASH_CHARS</code>
 9        attributes are both optional, but you may only specify one, not both. If
10        both are specified, <code class="literal">HASH_CHARS</code> is ignored and an
11        error is shown. Whenever possible, use a literal prefix to specify a
12        <code class="literal">SEQ_REGEXP</code>. If the starting prefix is always the
13        same, use <code class="literal">HASH_CHAR</code> and provide as much prefix as
14        possible. Only in rare cases would you omit both attributes, such as the
15        case where there is no other reliable way to get the highlighting you
16        need, for example, with comments in the Cobol programming
17        language.</p><p>The regular expression match cannot span more than one
18        line.</p><p>Regular expression syntax is described in <a class="xref" href="regexps.html" title="Appendix E. Regular Expressions">Appendix E, <i>Regular Expressions</i></a>.</p><p><span class="bold"><strong>NOTE</strong></span>: c-style character escaping
19        for literals (such as the tab char: \t) do not work as attribute values
20        in XML. Use the XML character entity instead. For example: &amp;#09;
21        instead of \t.</p><p>Here is a <code class="literal">SEQ_REGEXP</code> rule from moin.xml that
22        uses the <code class="literal">HASH_CHARS</code> attribute, to describe a keyword
23        (wikiword) that can start with any uppercase letter and contain lower
24        case letters and at least one uppercase letter in the middle.</p><pre class="programlisting">
25 		&lt;SEQ_REGEXP HASH_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZ" AT_WORD_START="TRUE" TYPE="KEYWORD2"&gt;[A-Z][a-z]+[A-Z][a-zA-Z]+&lt;/SEQ_REGEXP&gt;
26 </pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mode-rule-seq.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="writing-modes.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mode-rule-import.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The SEQ Tag </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The IMPORT Tag</td></tr></table></div></body></html>