API » History » Version 1
iri, 02/23/2011 08:35 PM
1 | 1 | iri | h1. API |
---|---|---|---|
2 | |||
3 | h2. Easy interface : |
||
4 | |||
5 | Here, the functions take several default parameters. They are useful if you need just to do basic manipulation. |
||
6 | |||
7 | h3. _pcreEasyMatch |
||
8 | |||
9 | Scans for a match in string for pattern. |
||
10 | |||
11 | Prototype : *fun [S S] I* |
||
12 | |||
13 | # S : pattern : any valid regular expression |
||
14 | # S : string : any string to scan for matches |
||
15 | |||
16 | +Return+ : I : 1 if matched, otherwise 0. (or nil if error) |
||
17 | |||
18 | h3. _pcreEasySplit |
||
19 | |||
20 | Breaks the string on the pattern, and returns an list of the tokens. |
||
21 | |||
22 | Prototype : *fun [S S] [S r1]* |
||
23 | |||
24 | # S : pattern : any valid regular expression |
||
25 | # S : string : any string to scan for matches |
||
26 | |||
27 | +Return+ : [S r1] : a list of string or nil if error |
||
28 | |||
29 | h3. _pcreEasyReplace |
||
30 | |||
31 | Replaces all occurrences of the pattern in the string with the replacement text. |
||
32 | |||
33 | Prototype : *fun [S S S] S* |
||
34 | |||
35 | # S : pattern : any valid regular expression |
||
36 | # S : string : any string to scan for matches |
||
37 | # S : replace : any text to replace each match with |
||
38 | |||
39 | +Return+ : S : the new string (or nil if error) |
||
40 | |||
41 | |||
42 | h2. Normal interface : |
||
43 | |||
44 | Here, you can configure the result |