Thread Berechnung der Laenge von Unterbrechungen im HSDPA netz (37 answers)
Opened by bowkatz at 2009-07-08 10:02

renee
 2009-07-13 10:48
#123095 #123095
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
ungetestet:
Code (perl): (dl )
1
2
3
4
5
while( ... ) {
    unless( $line =~ /\A\d+\.\d+-\d+\.\d+\s+\d+\s+\d+\z/ ) {
        next;
    }
}


Und das sagt CPAN:YAPE::Regex::Explain zu dem Regulären Ausdruck:
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
The regular expression:

(?-imsx:\A\d+\.\d+-\d+\.\d+\s+\d+\s+\d+\z)

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):
----------------------------------------------------------------------
\A the beginning of the string
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
\. '.'
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
- '-'
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
\. '.'
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
\s+ whitespace (\n, \r, \t, \f, and " ") (1 or
more times (matching the most amount
possible))
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
\s+ whitespace (\n, \r, \t, \f, and " ") (1 or
more times (matching the most amount
possible))
----------------------------------------------------------------------
\d+ digits (0-9) (1 or more times (matching
the most amount possible))
----------------------------------------------------------------------
\z the end of the string
----------------------------------------------------------------------
) 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 Berechnung der Laenge von Unterbrechungen im HSDPA netz