in reply to Simple regex needed

Without looking too much into it, a fast Q&D would be as follows:

# Test line $line = "------------------- Frame 1 ------"; # Parse it by changing all -, letters, and spaces into nothing $line =~ s/[\-|A-Z|a-z|\s+]//g; # Print the line which returns '1' or whatever number it might be print "$line\n";
Hope this helps! There's more extravagant ways to do it but that works effectively to solve your situation.