Tag library reference for the following tag libraries:
null null null null
This is version 1.0.1.
Required attributes are marked with a *
Uses a regexp to determine if a match exists in the text.
Can contain: JSP
null
<%-- create the match regexp "m/test1/mi" --%>
<rx:regexp id="rx1">m/test1/mi</rx:regexp>
<%-- set the text to match on --%>
<rx:text id="test">
This is a
test of regular expression matching.
</rx:text>
See if a match exists...<br>
<rx:existsMatch regexp="rx1" text="test">
A match was found!<br>
</rx:existsMatch>
<rx:existsMatch regexp="rx1" text="test" value="false">
A match was not found!<br>
</rx:existsMatch>
| Name | Description | Type |
|---|---|---|
| regexp* | Script variable id of null to use for match. | String |
| text* | Script variable id of null to check for a match. | String |
| value | If value is set to null the existsMatch tag includes body of tag if a match does not exist. Default is null. | String |
Get the value of a single parenthesized group within a single match.
Can contain: empty
null
<%-- set the text to perform match --%>
<rx:text id="test">
This is
test1 of a regular expression match,
on words that start with 'i' like item and
index, the group tag will be used to get the
next word after the word starting with 'i'.
</rx:text>
<%-- create the match regexp "m/\si[^\s]*\s([^\s]+)/mi" --%>
<rx:regexp id="rx4">m/\si[^\s]*\s([^\s]+)/mi</rx:regexp>
<pre>
<rx:match id="mtch" text="test" regexp="rx4">
Match: <jsp:getProperty name="mtch" property="match"/><br>
Parenthesized Group 1: <rx:group number="1"/>
</rx:match></pre>
| Name | Description | Type |
|---|---|---|
| number* | Parenthesised group number to get from match. | String |
Loops through each match found in a text string by a regexp.
Can contain: JSP
null
<%-- set the text to perform match --%>
<rx:text id="test">
This is
test1 of a regular expression match,
on words that start with 'i' like item and
index.
</rx:text>
<%-- create the match regexp "m/\si[^\s]*\s/mi" --%>
<rx:regexp id="rx4">m/\si[^\s]*\s/mi</rx:regexp>
<pre>
<rx:match id="mtch" text="test" regexp="rx4">
Match: <jsp:getProperty name="mtch" property="match"/><br>
Pre Match: <jsp:getProperty name="mtch" property="preMatch"/><br>
Post Match: <jsp:getProperty name="mtch" property="postMatch"/><br>
</rx:match>
| Name | Description | Type |
|---|---|---|
| id* | Script variable id for use with standard null tag. | String |
| regexp* | Script variable id of null to use for match. | String |
| text* | Script variable id of null to perform match on. | String |
| Name | Type | Scope | Description |
|---|---|---|---|
| specified via id | org.apache.taglibs.regexp.MatchTag | NESTED | Match Data Bean |
Create a regular expression script variable.
Can contain: JSP
Enter a JSP comment without the opening and closing tags.
Those will be added by the XSL. Put no HTML mark-up in here.
Currently, only one comment per usage section is supported.
null
The code element is for an example of using the tag. I
normally put these in CDATA sections so that the XSL
transform to HTML will turn the angle brackets into the
appropriate < and > entities automatically. Only
one code element per usage element is supported.
The resultant HTML is formatted and colorized.
<rx:regexp id="rx1">m/test1/mi</rx:regexp>
The regular expression is:
<jsp:getProperty name="rx1" property="regexp"/>
| Name | Description | Type |
|---|---|---|
| id* | Script variable id for use with standard null tag and as an attribute to other tags in this tag library. | String |
| Name | Type | Scope | Description |
|---|---|---|---|
| specified via id | org.apache.taglibs.regexp.RegexpData | AT_BEGIN | Regular Expression Bean |
Implements a perl style split on the text.
Can contain: JSP
null
<%-- set the text to split --%>
<rx:text id="test">
This is
test1 of a regular expression split,
on whitespace, and then on a comma.
</rx:text>
<ul>
<rx:split id="split" text="test">
<jsp:getProperty name="split" property="split"/><br>
</rx:split>
</ul>
<%-- now split the text using a comma with limit of 2 --%>
<rx:regexp id="rx3">/,/m</rx:regexp>
<ul>
<rx:split id="split" text="test" regexp="rx3" limit="2">
<jsp:getProperty name="split" property="split"/><br>
</rx:split>
</ul>
| Name | Description | Type |
|---|---|---|
| id* | Script variable id for use with standard null tag. | String |
| limit | Set a limit for the number of strings split out from text. | String |
| regexp | Script variable id of null to use for split. If no null is used the split will be done based on whitespace. | String |
| text* | Script variable id of null to perform split on. | String |
| Name | Type | Scope | Description |
|---|---|---|---|
| specified via id | org.apache.taglibs.regexp.SplitTag | NESTED | Split Data Bean |
Performs a string substitution on text using a regexp.
Can contain: JSP
null
<%-- create the substitute regexp "s/test1/test2/gmi" --%>
<rx:regexp id="rx2">s/test1/test2/gmi</rx:regexp>
<%-- set the text to match on --%>
<rx:text id="test">
This is
test1 of regular expression substitution.
</rx:text>
Here is the text after substitution...<br>
<rx:substitute regexp="rx2" text="test"/>
| Name | Description | Type |
|---|---|---|
| regexp* | Script variable id of null to use for substitute. | String |
| text* | Script variable id of null to perform substitution on. | String |
Create a text string script variable for use with a regexp.
Can contain: JSP
null
<rx:text id="tx1">This is a test string.</rx:text>
The text string is:
<jsp:getProperty name="tx1" property="text"/>
| Name | Description | Type |
|---|---|---|
| id* | Script variable id for use with standard null tag and as an attribute to other tags in this tag library. | String |
| Name | Type | Scope | Description |
|---|---|---|---|
| specified via id | org.apache.taglibs.regexp.TextData | AT_BEGIN | Text String Bean |