|
@@ -12,58 +12,58 @@ |
|
|
block discarded – undo |
|
12
|
12
|
use phoponent\framework\traits\static_class; |
|
13
|
13
|
|
|
14
|
14
|
class regexp { |
|
15
|
|
- use static_class; |
|
|
15
|
+ use static_class; |
|
16
|
16
|
|
|
17
|
|
- public static function get_regexp_for_autoclosed_tags_without_arguments():string { |
|
18
|
|
- return '`\<'.self::get_regexp_for_tag_name().'\/\>`'; |
|
19
|
|
- } |
|
20
|
|
- public static function get_regexp_for_autoclosed_tags_without_arguments_and_spaces():string { |
|
21
|
|
- return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_juste_space().'\/\>`'; |
|
22
|
|
- } |
|
23
|
|
- public static function get_regexp_for_autoclosed_tags_with_arguments():string { |
|
24
|
|
- return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_attributs().'\/\>`'; |
|
25
|
|
- } |
|
|
17
|
+ public static function get_regexp_for_autoclosed_tags_without_arguments():string { |
|
|
18
|
+ return '`\<'.self::get_regexp_for_tag_name().'\/\>`'; |
|
|
19
|
+ } |
|
|
20
|
+ public static function get_regexp_for_autoclosed_tags_without_arguments_and_spaces():string { |
|
|
21
|
+ return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_juste_space().'\/\>`'; |
|
|
22
|
+ } |
|
|
23
|
+ public static function get_regexp_for_autoclosed_tags_with_arguments():string { |
|
|
24
|
+ return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_attributs().'\/\>`'; |
|
|
25
|
+ } |
|
26
|
26
|
|
|
27
|
|
- public static function get_regexp_for_no_autoclosed_tags_with_content_and_arguments():string { |
|
28
|
|
- return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_attributs().'\>'.self::get_regexp_for_content().'\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
29
|
|
- } |
|
30
|
|
- public static function get_regexp_for_no_autoclosed_tags_with_content_and_not_arguments_and_spaces():string { |
|
31
|
|
- return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_juste_space().'\>'.self::get_regexp_for_content().'\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
32
|
|
- } |
|
33
|
|
- public static function get_regexp_for_no_autoclosed_tags_with_content_and_not_arguments():string { |
|
34
|
|
- return '`\<'.self::get_regexp_for_tag_name().'\>'.self::get_regexp_for_content().'\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
35
|
|
- } |
|
|
27
|
+ public static function get_regexp_for_no_autoclosed_tags_with_content_and_arguments():string { |
|
|
28
|
+ return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_attributs().'\>'.self::get_regexp_for_content().'\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
|
29
|
+ } |
|
|
30
|
+ public static function get_regexp_for_no_autoclosed_tags_with_content_and_not_arguments_and_spaces():string { |
|
|
31
|
+ return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_juste_space().'\>'.self::get_regexp_for_content().'\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
|
32
|
+ } |
|
|
33
|
+ public static function get_regexp_for_no_autoclosed_tags_with_content_and_not_arguments():string { |
|
|
34
|
+ return '`\<'.self::get_regexp_for_tag_name().'\>'.self::get_regexp_for_content().'\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
|
35
|
+ } |
|
36
|
36
|
|
|
37
|
|
- public static function get_regexp_for_no_autoclosed_tags_without_content_and_with_arguments():string { |
|
38
|
|
- return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_attributs().'>\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
39
|
|
- } |
|
40
|
|
- public static function get_regexp_for_no_autoclosed_tags_without_content_and_arguments_and_with_spaces():string { |
|
41
|
|
- return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_juste_space().'\>\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
42
|
|
- } |
|
43
|
|
- public static function get_regexp_for_no_autoclosed_tags_without_content_and_arguments():string { |
|
44
|
|
- return '`\<'.self::get_regexp_for_tag_name().'\>\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
45
|
|
- } |
|
|
37
|
+ public static function get_regexp_for_no_autoclosed_tags_without_content_and_with_arguments():string { |
|
|
38
|
+ return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_attributs().'>\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
|
39
|
+ } |
|
|
40
|
+ public static function get_regexp_for_no_autoclosed_tags_without_content_and_arguments_and_with_spaces():string { |
|
|
41
|
+ return '`\<'.self::get_regexp_for_tag_name().self::get_regexp_for_juste_space().'\>\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
|
42
|
+ } |
|
|
43
|
+ public static function get_regexp_for_no_autoclosed_tags_without_content_and_arguments():string { |
|
|
44
|
+ return '`\<'.self::get_regexp_for_tag_name().'\>\<\/'.self::get_regexp_for_tag_name(true).'\>`'; |
|
|
45
|
+ } |
|
46
|
46
|
|
|
47
|
|
- private static function get_regexp_for_content():string { |
|
48
|
|
- return '([\ a-zA-Z0-9\=\-\_\\\'\"\%\é\&\;\,\:\/\!\§\*ù\$\^\#\{\}\[\]\(\)\+\?\\n\\t]+)'; |
|
|
47
|
+ private static function get_regexp_for_content():string { |
|
|
48
|
+ return '([\ a-zA-Z0-9\=\-\_\\\'\"\%\é\&\;\,\:\/\!\§\*ù\$\^\#\{\}\[\]\(\)\+\?\\n\\t]+)'; |
|
49
|
49
|
} |
|
50
|
50
|
|
|
51
|
51
|
private static function get_regexp_for_attributs():string { |
|
52
|
|
- return '\ ([\ a-zA-Z0-9\=\-\_\\\'\"\%\é\&\;\,\:\/\.\!\§\*ù\$\^\#\{\}\[\]\(\)\+\?\\n\\t]+)'; |
|
|
52
|
+ return '\ ([\ a-zA-Z0-9\=\-\_\\\'\"\%\é\&\;\,\:\/\.\!\§\*ù\$\^\#\{\}\[\]\(\)\+\?\\n\\t]+)'; |
|
53
|
53
|
} |
|
54
|
54
|
|
|
55
|
55
|
private static function get_regexp_for_juste_space():string { |
|
56
|
|
- return '[\ ]+'; |
|
|
56
|
+ return '[\ ]+'; |
|
57
|
57
|
} |
|
58
|
58
|
|
|
59
|
59
|
private static function get_regexp_for_tag_name($close = false):string { |
|
60
|
|
- $start = $close ? '' : '('; |
|
61
|
|
- $end = $close ? '' : ')'; |
|
62
|
|
- return $start.'[A-Z][A-Za-z0-9\-\_]+'.$end; |
|
|
60
|
+ $start = $close ? '' : '('; |
|
|
61
|
+ $end = $close ? '' : ')'; |
|
|
62
|
+ return $start.'[A-Z][A-Za-z0-9\-\_]+'.$end; |
|
63
|
63
|
} |
|
64
|
64
|
|
|
65
|
65
|
public static function regexp_for_parse_attributs_with_only_integers():string { |
|
66
|
|
- return '`([\w\-]+\=\\d+)+`'; |
|
|
66
|
+ return '`([\w\-]+\=\\d+)+`'; |
|
67
|
67
|
} |
|
68
|
68
|
|
|
69
|
69
|
public static function regexp_for_parse_attributs():string { |