in reply to Regex problem

What input are you trying?

If indeed you've tried this string:
............ keyword=nn ............
Then the regexp you've used won't work. It'll brake right after the 'keyword=' part as 'nn' string doesn't match '\d+' expression.

However, this works:
while(<DATA>) { m/^(.+?\s+keyword=)(\d+)(\s+.+)$/; print "$1-" if $1; print "$2-" if $2; print "$3" if $3; print "\n"; } __DATA__ ............ keyword=12 ............


_____________________
# Under Construction