Re: Regex searches including spaces

From: Gary Stainburn (gary.stainburn_at_ringways.co.uk)
Date: 10/23/03

  • Next message: Extern Chakirov Timour: "Tool for Tk developer?"
    To: "Paul Harwood" <harwood@nyclimits.org>, "Beginner Perl" <beginners@perl.org>
    Date: Thu, 23 Oct 2003 12:34:57 +0100
    
    

    On Thursday 23 Oct 2003 1:03 am, Paul Harwood wrote:
    > I am trying to parse through the following line:
    >
    > TUITimer> TUI Dead Air Timer::1828ms::
    >
    > I want to extract the 1828 value. The regex I have is:
    >
    > if ( /TUI Dead Air(\d+)/ ) {
    >
    > I know this is wrong but I have tried every variation of \s that I can
    > think of with no success. Also, is there a Regex generator of some kind
    > where I can enter text searches and have them translated to Perl Regex
    > format? I am using a Win32 platform.
    >
    > --Paul

    Hi Paul,

    you missed out the colons. Have a look at

    #!/usr/bin/perl -w

    $_='TUITimer> TUI Dead Air Timer::1828ms::';

    print "$1\n" if (/Dead Air Timer::(\d+)ms/) ;
      

    -- 
    Gary Stainburn
     
    This email does not contain private or confidential material as it
    may be snooped on by interested government parties for unknown
    and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     
    

  • Next message: Extern Chakirov Timour: "Tool for Tk developer?"

    Relevant Pages

    • RE: Regex searches including spaces
      ... Paul Harwood wrote: ... >I want to extract the 1828 value. ... The regex I have is: ... >I know this is wrong but I have tried every variation ...
      (perl.beginners)
    • Extracting Name Value Pairs
      ... Hi I have a long line of text that I want to parse for name/value pairs ... can i use RegEx to extract name value pairs? ... A resource for the Microsoft Dynamics Community ...
      (microsoft.public.scripting.vbscript)
    • regex needed
      ... Can someone please give me a regex to parse the following... ... I need to use the rule number in another command to delete the route entry... ... So I presume I'll need to extract it via the regex ...
      (perl.beginners)