Re: Regex searches including spaces
From: Gary Stainburn (gary.stainburn_at_ringways.co.uk)
Date: 10/23/03
- Previous message: Raghu Murthy: "Re: Deleting # and other characters"
- In reply to: Paul Harwood: "Regex searches including spaces"
- Next in thread: Alan Perry: "RE: Regex searches including spaces"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Raghu Murthy: "Re: Deleting # and other characters"
- In reply to: Paul Harwood: "Regex searches including spaces"
- Next in thread: Alan Perry: "RE: Regex searches including spaces"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|