ogxela has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to extract page sizes from various PDF files, and I'm using the following regex to do so: my ($x, $y) = m/^\/MediaBox \[ \S+ \S+ (\S+) (\S+) \]$/;
an example of a typical line that might be matched here is:
/MediaBox [ 0 0 614.39999 792 ]
where I'm trying to get the last two numbers into $1 and $2. But, I keep getting uninitialized values instead.
Help please!
Update: Escaping the brackets doesn't change anything
Thanks,
Alex
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex problem
by Zed_Lopez (Chaplain) on Nov 04, 2004 at 01:41 UTC | |
by ogxela (Novice) on Nov 04, 2004 at 01:46 UTC | |
|
Re: Regex problem
by erix (Prior) on Nov 04, 2004 at 01:48 UTC | |
|
Re: Regex problem
by injunjoel (Priest) on Nov 04, 2004 at 01:19 UTC |