Can't get group to match - please help



This seemingly simple regex is causing me problems

my $test = "Pub LOC.REC.USEIB03375MAR09.mngref0 #010C9D94";
my ($res) = ($test =~ /Pub (\w+{\.\w+})\s#.*/);
if( $res ){
print "\n$res\n";
}


The problem is to extract the "LOC.REC.USEIB03375MAR09.mngref0" part of
the string, which may have three to six parts - so it could be
LOC.REC.USEIB03375MAR09 or it could be
LOC.REC.USEIB03375MAR09.mngref0.day9.test


What am I doing wrong ??

.



Relevant Pages

  • Re: Regex question
    ... structure of the date you're trying to extract. ... For example, in Regex you can ... pattern that will ensure a valid date within the range allowed by T-SQL ... valid date from a string. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: regular expression question
    ... I am a newbie to regular expressions and want to extract a number from the ... end of a string within an HTML document. ... A really nice free regex editor is called expresso. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Regex question
    ... If you want to pull a valid date from a string, then you have to write a pattern that defines the lexical structure of the date you're trying to extract. ... What you're trying to do is simple by Regex standards, but still requires a lot more specificity than "a digit or a slash". ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Convert String to COlor
    ... It is possible with that string to extract it using a regex, ... indexof or any combination of that. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Regex question
    ... valid date from a string. ... Stop using Replace to get rid of the stuff you don't want, ... get and then craft a regex to EXTRACT those parts. ...
    (microsoft.public.dotnet.languages.csharp)