Thread Regulärer Ausdruck String kürzen (9 answers)
Opened by wizard at 2010-10-27 10:19

renee
 2010-10-27 10:33
#142217 #142217
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
CPAN:YAPE::Regex::Explain gibt zu dem Regex folgende Erklärung:

Code: (dl )
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
(?-imsx:^((?:[^_]+_){2}[^_]+)_)

matches as follows:

NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with ^ and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
^ the beginning of the string
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
(?: group, but do not capture (2 times):
----------------------------------------------------------------------
[^_]+ any character except: '_' (1 or more
times (matching the most amount
possible))
----------------------------------------------------------------------
_ '_'
----------------------------------------------------------------------
){2} end of grouping
----------------------------------------------------------------------
[^_]+ any character except: '_' (1 or more
times (matching the most amount
possible))
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
_ '_'
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Regulärer Ausdruck String kürzen