in reply to Better way to do this, regex etc.

Better? Probably not. Just for fun!

#! perl -slw use strict; my $bug_fix_msg = "this 33,44 is a fix for mybug44,99 real \ bug 99 again bug33r bug1722,3 bUg:99, \ bugs:456, 17, 24 bugs 42,58 bug: 50,50"; my @bugs = sort{$a<=>$b} keys %{{ map { map{ $_ => 1 } split ',\s*', $_; } $bug_fix_msg =~ m[ \bbug s? :? \s* ( \d+\b (?: , \s* \d+\b )* ) ]gmsx }}; print "@bugs"; __END__ C:\test>junk3 3 17 24 42 50 58 99 456 1722

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."