It's Monday and I'm sure I am doing something stupid with my regexp. But because it's Monday, I am looking for someone to tell me what I am doing wrong.
In essence, I am trying to parse out a Linux component string from its version string. Because the component name can contain one or more digits, I see
In essence, I am trying to parse out a Linux component string from its version string. Because the component name can contain one or more digits, I see
Code:
[jdoe:cheech ~]$ tclsh
% set rpm foo123-0.7.8-9
foo123-0.7.8-9
% regexp {(.*?)-(\d.*)} $rpm match rpmName rpmVers
1
% puts $rpmName
foo123
% puts $rpmVers
0
% puts $match
foo123-0
%