Your first regexp was very close. You want to match more than one alphanumeric.
$line =~ m/([a-zA-Z0-9]+)$/;
Two other points:
For your second problem, you're looking for the text between two backslashes that is followed by a space:
m{\\([a-zA-Z0-9]+)\\\s}
In reply to Re: Two regex problems (easy)
by FunkyMonk
in thread Two regex problems (easy)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |