regex
Evaluate Regular Expression matching on a string
Index > Books > Declarative Development Guide > Reference Library > Accessor Listing > regex

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:ext:sys

Definition

Active URI Base

active:regex

Format

<instr>
  <type>regex</type>
  <operand>
    <string>Mambo is a dog</string>
  </operand>
  <operator>
    <regex>
      <pattern>(.*)is a(.*)</pattern>
      <rewrite>$1is black</rewrite>
    </regex>
  </operator>
  <target>this:response</target>
</instr>

Syntax

ArgumentRulesDescription
typeMandatory regex
operandMandatory Fragment OKdocument or fragment whose text nodes are to be used as the value to test
operatorMandatory a document specifying properties for the regex evaluation
targetMandatory the result document

Operator Syntax

The pattern element must contain the text of a valid parseable regular expression as defined by Javadoc

The rewrite element must contain the text of a valid rewrite rule. This is a string where each $n where n is an integer starting at 1 is a capturing group in the regular expression.

Result document

The result document is of the following structure:

<regex>
  <matches>true</matches>
  <rewrite>Mambo is black</rewrite>
  <group>Mambo</group>
  <group>dog</group>
</regex>


(C) 2003, 1060 Research Limited
© 2003-2005, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.