/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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <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
- <code class="literal">SEQ</code> rule except the match sequence is taken to be a
- regular expression. In addition to the attributes supported by the
- <code class="literal">SEQ</code> tag, the following attributes are
- supported:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">HASH_CHAR</code> - a literal string which must
- be at the start of a regular expression.</p></li><li><p><code class="literal">HASH_CHARS</code> - a list of possible literal
- characters, one of which must match at the start of the regular
- expression.</p></li></ul></div><p><code class="literal">HASH_CHAR</code> and <code class="literal">HASH_CHARS</code>
- attributes are both optional, but you may only specify one, not both. If
- both are specified, <code class="literal">HASH_CHARS</code> is ignored and an
- error is shown. Whenever possible, use a literal prefix to specify a
- <code class="literal">SEQ_REGEXP</code>. If the starting prefix is always the
- same, use <code class="literal">HASH_CHAR</code> and provide as much prefix as
- possible. Only in rare cases would you omit both attributes, such as the
- case where there is no other reliable way to get the highlighting you
- need, for example, with comments in the Cobol programming
- language.</p><p>The regular expression match cannot span more than one
- 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
- for literals (such as the tab char: \t) do not work as attribute values
- in XML. Use the XML character entity instead. For example: &#09;
- instead of \t.</p><p>Here is a <code class="literal">SEQ_REGEXP</code> rule from moin.xml that
- uses the <code class="literal">HASH_CHARS</code> attribute, to describe a keyword
- (wikiword) that can start with any uppercase letter and contain lower
- case letters and at least one uppercase letter in the middle.</p><pre class="programlisting">
- <SEQ_REGEXP HASH_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZ" AT_WORD_START="TRUE" TYPE="KEYWORD2">[A-Z][a-z]+[A-Z][a-zA-Z]+</SEQ_REGEXP>
- </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>