File: rtestregex.mac

package info (click to toggle)
maxima 5.47.0-9
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 193,104 kB
  • sloc: lisp: 434,678; fortran: 14,665; tcl: 10,990; sh: 4,577; makefile: 2,763; ansic: 447; java: 328; python: 262; perl: 201; xml: 60; awk: 28; sed: 15; javascript: 2
file content (46 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(kill (all), 0);
0;

( regex : regex_compile("ne{2}dle"),
  str : "his hay needle stack -- my hay needle stack -- her hay needle stack",
  0);
0;

regex_match_pos(regex, str);
[[9, 15]];

regex_match_pos("ne{2}dle", str); 
[[9, 15]];

regex_match_pos("ne{2}dle", str, 25, 44);
[[32, 38]];

regex_match_pos("ne{2}dle", str, 32, 38);
[[32, 38]];

regex_match_pos("ne{2}dle", str, 25, 37);
false;

regex_match_pos("ne{2}dle", str, 25);
[[32, 38]];

regex_match("ne{2}dle", "hay needle stack");
["needle"];

regex_split("[,;]+", "split,pea;;;soup");
["split", "pea", "soup"];

regex_subst_first("ty", "t.", "liberte egalite fraternite");
"liberty egalite fraternite";

regex_subst("ty", "t.", "liberte egalite fraternite");
"liberty egality fratyrnity";

regex_split("\\D+", "13. 3. 2009  13:03 Uhr");
["13", "3", "2009", "13", "03"];

string_to_regex(". :");
"\\. :";

(remvalue(regex, str), 0); 
0;