1Regex.matchOnly(3kaya) Kaya module reference Regex.matchOnly(3kaya)
2
3
4
6 Regex::matchOnly - Attempt to match a regular expression.
7
9 Match matchOnly( Regex x, String str )
10
12 x A compiled regular expression
13
14 str The String to match
15
17 Attempt to match a compiled regular expression to a string, returning a
18 Regex.Match (3kaya) object.
19
20
21 r = compile("s$");
22 s1 = "sausages";
23 m1 = match(r,s1); // matches(["s"],"sausage","")
24 s2 = "a sausage";
25 m2 = match(r,s2); // noMatch
26
27 This will only return the match in the match object, and not the
28 strings before and after the match - this is more efficient because it
29 does not need to construct new strings.
30
31 str may be a Tainted string, and the strings in the Match object will
32 not be tainted.
33
35 Kaya standard library by Edwin Brady, Chris Morris and others
36 (kaya@kayalang.org). For further information see http://kayalang.org/
37
39 The Kaya standard library is free software; you can redistribute it
40 and/or modify it under the terms of the GNU Lesser General Public
41 License (version 2.1 or any later version) as published by the Free
42 Software Foundation.
43
45 Regex.compile (3kaya)
46 Regex.quickMatch (3kaya)
47 Regex.quickMatch_1 (3kaya)
48 Builtins.Tainted (3kaya)
49
50
51
52Kaya December 2010 Regex.matchOnly(3kaya)