Welcome to the Perl community (the language is Perl, the program is perl). What have you tried so far? Can you successfully input and output the data? The monastery is happy to help, though if you post what you've tried so far, it helps us help you by telling us more about your experience level. Read How do I post a question effectively? for more information on what we'd find useful.
Since your title focuses on regular expressions, I'll assume that's where your issue lies. If we assume all lines of interest consist of 'pass' followed by whitespace, a colon and your desired value which will be an integer, then the following code should be a useful template:
use strict; use warnings; while (my $line = <DATA>) { if ($line =~ /^pass\s*\:(\d+)/) { print "$1\n"; } } __DATA__ abcd pass :10 adlksfkldf kkjfkdf :112
See Extracting matches for more information on extracting information. If this code is unclear, I'd be happy to provide additional clarification.
In reply to Re: Regex doubts
by kennethk
in thread Regex doubts
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |