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
In reply to Regex problem by ogxela
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |