Skip to content

Commit 78c18cc

Browse files
[WSO2-Release] [Release 5.0.4] update documentation for release 5.0.4
1 parent 76e75e1 commit 78c18cc

File tree

5 files changed

+240
-24
lines changed

5 files changed

+240
-24
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ For information on <a target="_blank" href="https://siddhi.io/">Siddhi</a> and i
1919

2020
## Latest API Docs
2121

22-
Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.3">5.0.3</a>.
22+
Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.4">5.0.4</a>.
2323

2424
## Features
2525

26-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.3/#find-function">find</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>These methods attempt to find the subsequence of the 'inputSequence' that matches the given 'regex' pattern.</p></div>
27-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.3/#group-function">group</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>This method returns the input subsequence captured by the given group during the previous match operation.</p></div>
28-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.3/#lookingat-function">lookingAt</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>This method attempts to match the 'inputSequence', from the beginning, against the 'regex' pattern.</p></div>
29-
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.3/#matches-function">matches</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>This method attempts to match the entire 'inputSequence' against the 'regex' pattern.</p></div>
26+
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.4/#find-function">find</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>Finds the subsequence that matches the given regex pattern.</p></div>
27+
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.4/#group-function">group</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>Returns the subsequence captured by the given group during the regex match operation.</p></div>
28+
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.4/#lookingat-function">lookingAt</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>Match the input.sequence from the beginning against the regex pattern, and unlike <code>regex:matches() it does not require that the entire input.sequence be matched.</code></p></div>
29+
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-execution-regex/api/5.0.4/#matches-function">matches</a> *(<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">Function</a>)*<br> <div style="padding-left: 1em;"><p>Matches the entire input.sequence against the regex pattern.</p></div>
3030

3131
## Dependencies
3232

docs/api/5.0.4.md

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# API Docs - v5.0.4
2+
3+
!!! Info "Tested Siddhi Core version: *<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/">5.0.2</a>*"
4+
It could also support other Siddhi Core minor versions.
5+
6+
## Regex
7+
8+
### find *<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">(Function)</a>*
9+
<p style="word-wrap: break-word">Finds the subsequence that matches the given regex pattern.</p>
10+
<span id="syntax" class="md-typeset" style="display: block; font-weight: bold;">Syntax</span>
11+
12+
```
13+
<BOOL> regex:find(<STRING> regex, <STRING> input.sequence)
14+
<BOOL> regex:find(<STRING> regex, <STRING> input.sequence, <INT> starting.index)
15+
```
16+
17+
<span id="query-parameters" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">QUERY PARAMETERS</span>
18+
<table>
19+
<tr>
20+
<th>Name</th>
21+
<th style="min-width: 20em">Description</th>
22+
<th>Default Value</th>
23+
<th>Possible Data Types</th>
24+
<th>Optional</th>
25+
<th>Dynamic</th>
26+
</tr>
27+
<tr>
28+
<td style="vertical-align: top">regex</td>
29+
<td style="vertical-align: top; word-wrap: break-word">A regular expression that is matched to a sequence in order to find the subsequence of the same. For example, <code>\d\d(.*)WSO2</code>.</td>
30+
<td style="vertical-align: top"></td>
31+
<td style="vertical-align: top">STRING</td>
32+
<td style="vertical-align: top">No</td>
33+
<td style="vertical-align: top">Yes</td>
34+
</tr>
35+
<tr>
36+
<td style="vertical-align: top">input.sequence</td>
37+
<td style="vertical-align: top; word-wrap: break-word">The input sequence to be matched with the regular expression. For example, <code>21 products are produced by WSO2</code>.</td>
38+
<td style="vertical-align: top"></td>
39+
<td style="vertical-align: top">STRING</td>
40+
<td style="vertical-align: top">No</td>
41+
<td style="vertical-align: top">Yes</td>
42+
</tr>
43+
<tr>
44+
<td style="vertical-align: top">starting.index</td>
45+
<td style="vertical-align: top; word-wrap: break-word">The starting index of the input sequence from where the input sequence ismatched with the given regex pattern.For example, <code>10</code>.</td>
46+
<td style="vertical-align: top">0</td>
47+
<td style="vertical-align: top">INT</td>
48+
<td style="vertical-align: top">Yes</td>
49+
<td style="vertical-align: top">Yes</td>
50+
</tr>
51+
</table>
52+
53+
<span id="examples" class="md-typeset" style="display: block; font-weight: bold;">Examples</span>
54+
<span id="example-1" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 1</span>
55+
```
56+
regex:find('\d\d(.*)WSO2', '21 products are produced by WSO2 currently')
57+
```
58+
<p style="word-wrap: break-word">This method attempts to find the subsequence of the input.sequence that matches the regex pattern, <code>\d\d(.*)WSO2</code>. It returns <code>true</code> as a subsequence exists.</p>
59+
60+
<span id="example-2" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 2</span>
61+
```
62+
regex:find('\d\d(.*)WSO2', '21 products are produced by WSO2.', 4)
63+
```
64+
<p style="word-wrap: break-word">This method attempts to find the subsequence of the input.sequence that matches the regex pattern, <code>\d\d(.*)WSO2</code> starting from index <code>4</code>. It returns 'false' as subsequence does not exists.</p>
65+
66+
### group *<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">(Function)</a>*
67+
<p style="word-wrap: break-word">Returns the subsequence captured by the given group during the regex match operation.</p>
68+
<span id="syntax" class="md-typeset" style="display: block; font-weight: bold;">Syntax</span>
69+
70+
```
71+
<STRING> regex:group(<STRING> regex, <STRING> input.sequence, <INT> group.id)
72+
```
73+
74+
<span id="query-parameters" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">QUERY PARAMETERS</span>
75+
<table>
76+
<tr>
77+
<th>Name</th>
78+
<th style="min-width: 20em">Description</th>
79+
<th>Default Value</th>
80+
<th>Possible Data Types</th>
81+
<th>Optional</th>
82+
<th>Dynamic</th>
83+
</tr>
84+
<tr>
85+
<td style="vertical-align: top">regex</td>
86+
<td style="vertical-align: top; word-wrap: break-word">A regular expression. For example, <code>\d\d(.*)WSO2.</code></td>
87+
<td style="vertical-align: top"></td>
88+
<td style="vertical-align: top">STRING</td>
89+
<td style="vertical-align: top">No</td>
90+
<td style="vertical-align: top">Yes</td>
91+
</tr>
92+
<tr>
93+
<td style="vertical-align: top">input.sequence</td>
94+
<td style="vertical-align: top; word-wrap: break-word">The input sequence to be matched with the regular expression. For example, 2<code>1 products are produced by WSO2</code>.</td>
95+
<td style="vertical-align: top"></td>
96+
<td style="vertical-align: top">STRING</td>
97+
<td style="vertical-align: top">No</td>
98+
<td style="vertical-align: top">Yes</td>
99+
</tr>
100+
<tr>
101+
<td style="vertical-align: top">group.id</td>
102+
<td style="vertical-align: top; word-wrap: break-word">The given group id of the regex expression. For example, <code>2</code>.</td>
103+
<td style="vertical-align: top"></td>
104+
<td style="vertical-align: top">INT</td>
105+
<td style="vertical-align: top">No</td>
106+
<td style="vertical-align: top">Yes</td>
107+
</tr>
108+
</table>
109+
110+
<span id="examples" class="md-typeset" style="display: block; font-weight: bold;">Examples</span>
111+
<span id="example-1" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 1</span>
112+
```
113+
regex:group('\d\d(.*)(WSO2.*)(WSO2.*)', '21 products are produced within 10 years by WSO2 currently by WSO2 employees', 3)
114+
```
115+
<p style="word-wrap: break-word">Function returns 'WSO2 employees', the subsequence captured by the groupID 3 according to the regex pattern, <code>\d\d(.*)(WSO2.*)(WSO2.*)</code>.</p>
116+
117+
### lookingAt *<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">(Function)</a>*
118+
<p style="word-wrap: break-word">Match the input.sequence from the beginning against the regex pattern, and unlike <code>regex:matches() it does not require that the entire input.sequence be matched.</code></p>
119+
<span id="syntax" class="md-typeset" style="display: block; font-weight: bold;">Syntax</span>
120+
121+
```
122+
<BOOL> regex:lookingAt(<STRING> regex, <STRING> input.sequence)
123+
```
124+
125+
<span id="query-parameters" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">QUERY PARAMETERS</span>
126+
<table>
127+
<tr>
128+
<th>Name</th>
129+
<th style="min-width: 20em">Description</th>
130+
<th>Default Value</th>
131+
<th>Possible Data Types</th>
132+
<th>Optional</th>
133+
<th>Dynamic</th>
134+
</tr>
135+
<tr>
136+
<td style="vertical-align: top">regex</td>
137+
<td style="vertical-align: top; word-wrap: break-word">A regular expression. For example, <code>\d\d(.*)WSO2</code>.</td>
138+
<td style="vertical-align: top"></td>
139+
<td style="vertical-align: top">STRING</td>
140+
<td style="vertical-align: top">No</td>
141+
<td style="vertical-align: top">Yes</td>
142+
</tr>
143+
<tr>
144+
<td style="vertical-align: top">input.sequence</td>
145+
<td style="vertical-align: top; word-wrap: break-word">The input sequence to be matched with the regular expression. For example, <code>21 products are produced by WSO2</code>.</td>
146+
<td style="vertical-align: top"></td>
147+
<td style="vertical-align: top">STRING</td>
148+
<td style="vertical-align: top">No</td>
149+
<td style="vertical-align: top">Yes</td>
150+
</tr>
151+
</table>
152+
153+
<span id="examples" class="md-typeset" style="display: block; font-weight: bold;">Examples</span>
154+
<span id="example-1" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 1</span>
155+
```
156+
regex:lookingAt('\d\d(.*)(WSO2.*)', '21 products are produced by WSO2 currently in Sri Lanka')
157+
```
158+
<p style="word-wrap: break-word">Function matches the input.sequence against the regex pattern, <code>\d\d(.*)(WSO2.*)</code> from the beginning, and as it matches it returns <code>true</code>.</p>
159+
160+
<span id="example-2" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 2</span>
161+
```
162+
regex:lookingAt('WSO2(.*)middleware(.*)', 'sample test string and WSO2 is situated in trace and it's a middleware company')
163+
```
164+
<p style="word-wrap: break-word">Function matches the input.sequence against the regex pattern, <code>WSO2(.*)middleware(.*)</code> from the beginning, and as it does not match it returns <code>false</code>.</p>
165+
166+
### matches *<a target="_blank" href="http://siddhi.io/en/v5.0/docs/query-guide/#function">(Function)</a>*
167+
<p style="word-wrap: break-word">Matches the entire input.sequence against the regex pattern.</p>
168+
<span id="syntax" class="md-typeset" style="display: block; font-weight: bold;">Syntax</span>
169+
170+
```
171+
<BOOL> regex:matches(<STRING> regex, <STRING> input.sequence)
172+
```
173+
174+
<span id="query-parameters" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">QUERY PARAMETERS</span>
175+
<table>
176+
<tr>
177+
<th>Name</th>
178+
<th style="min-width: 20em">Description</th>
179+
<th>Default Value</th>
180+
<th>Possible Data Types</th>
181+
<th>Optional</th>
182+
<th>Dynamic</th>
183+
</tr>
184+
<tr>
185+
<td style="vertical-align: top">regex</td>
186+
<td style="vertical-align: top; word-wrap: break-word">A regular expression. For example, <code>\d\d(.*)WSO2</code>.</td>
187+
<td style="vertical-align: top"></td>
188+
<td style="vertical-align: top">STRING</td>
189+
<td style="vertical-align: top">No</td>
190+
<td style="vertical-align: top">Yes</td>
191+
</tr>
192+
<tr>
193+
<td style="vertical-align: top">input.sequence</td>
194+
<td style="vertical-align: top; word-wrap: break-word">The input sequence to be matched with the regular expression. For example, <code>21 products are produced by WSO2</code>.</td>
195+
<td style="vertical-align: top"></td>
196+
<td style="vertical-align: top">STRING</td>
197+
<td style="vertical-align: top">No</td>
198+
<td style="vertical-align: top">Yes</td>
199+
</tr>
200+
</table>
201+
202+
<span id="examples" class="md-typeset" style="display: block; font-weight: bold;">Examples</span>
203+
<span id="example-1" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 1</span>
204+
```
205+
regex:matches('WSO2(.*)middleware(.*)', 'WSO2 is situated in trace and its a middleware company')
206+
```
207+
<p style="word-wrap: break-word">Function matches the entire input.sequence against <code>WSO2(.*)middleware(.*)</code> regex pattern, and as it matches it returns <code>true</code>.</p>
208+
209+
<span id="example-2" class="md-typeset" style="display: block; color: rgba(0, 0, 0, 0.54); font-size: 12.8px; font-weight: bold;">EXAMPLE 2</span>
210+
```
211+
regex:matches('WSO2(.*)middleware', 'WSO2 is situated in trace and its a middleware company')
212+
```
213+
<p style="word-wrap: break-word">Function matches the entire input.sequence against <code>WSO2(.*)middleware</code> regex pattern. As it does not match it returns <code>false</code>.</p>
214+

0 commit comments

Comments
 (0)