Hi,
I need to parse this string: 2005-03-11 13:49:41.19
to just get the hour and minute.
my program has:
if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
{
print("Hour:Minute = $4:$5\n");
}
This is breaking. If anyone can refine this, that would be great.
thanks,
radhika
--
Hello ,
i am sticking with a problem to replace all words of a file in such a =
manner that the first and second word need to interchanged.
some thing like ...
10 11 2 20001
so that the output file will be
11 1 20001 2
any helpful regex ???
thanks
Hi all,
I need small regexp help, I'm doing webpage, where I rewrite all links
in XML according weblang parameter.
So we have for example in XML (I have it in scalar variable):
Foo and Bars Link='http://example.com/' Foo and Bars
Foo and Bars Link='http://example.com/#anch
Which regular expression would you use to remove the and from a line
like this one:
Here goes a webpage's title
Thanks a lot in advance.
Hi Gurus !
Well need your help in framing a RegExp
I've to parse for the tag in a HTML/ASP file and then when i get that i need
to get only yhe action filepath in to an array ! How do i do it ?
For Example
i need only the "register/doregister.asp" in an array !
Please Help.
Thanks in
I'm trying to write a regular expression to divide up a line of text
into a hash, but am having a hard time with it. I'm hoping you all can
help me.
Here's an example line of text:
"( uiwgAttribute-OID NAME 'uiwgAttribute' DESC 'Contains meta data about
an attribute' SUP top MUST cn MAY ( uiwgAD
If someone could please help me.
I can't figure out how to use a variable in a regexp.
Example.
I am writing a script to parse a web log and report on all the hosts in the
log.
However I have a command line option to exclude a domain from the report.
My problem is that I can't figure out how to
just a simple question. I am new to the whole RegExp thing. It gets kind
of confusing. If someone could point me in the direction of a good tutorial
with plenty of examples or if someone could post a few regexp with small
code snippets and explain I would appreciate very much. Thanks in advanc
Ok,
I have a list/database of words that follows as ...
Top
Top/Arts/Food
Top/Arts/Food/Country
Top/World/America
Top/World/Japan
Top/World/Japan/Economy
Top/World/Japan/Food
Top/World/Japan/Food/Country
Top/World/Japan/Food/Country/By_Chef
How can I setup a regexp query
radhika wrote:
Hi,
I need to parse this string: 2005-03-11 13:49:41.19
to just get the hour and minute.
my program has:
if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
I guess it should have been =~ instead of =
{
print("Hour:Minute = $4:$5\n");
}
if ( $string =~ /.*\s+(\d\d):(\d\
radhika wrote:
> Hi,
> I need to parse this string: 2005-03-11 13:49:41.19
> to just get the hour and minute.
>
> my program has:
>
> if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
> {
>print("Hour:Minute = $4:$5\n");
> }
I doubt that you are running under strict and
> if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
> {
>print("Hour:Minute = $4:$5\n");
> }
>
You have an unmatched [ in your expression.
(\w+) doesn't match the "." if that matters to you.
> This is breaking. If anyone can refine this, that would be great.
> thanks,
> rad
radhika wrote:
Hi,
Hello,
I need to parse this string: 2005-03-11 13:49:41.19
to just get the hour and minute.
my program has:
if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ )
{
print("Hour:Minute = $4:$5\n");
}
This is breaking. If anyone can refine this, that would be great.
tha
Abhishek Dave schreef:
Hello ,
i am sticking with a problem to replace all words of a file in such a =
manner that the first and second word need to interchanged.
some thing like ...
10 11 2 20001
so that the output file will be
11 1 20001 2
any helpful regex ??
On Mar 28, Abhishek Dave said:
i am sticking with a problem to replace all words of a file in such a =
manner that the first and second word need to interchanged.
some thing like ...
10 11 2 20001
so that the output file will be
11 1 20001 2
The easiest way I can t
Ing. Branislav Gerzo schreef:
> I need small regexp help, I'm doing webpage, where I rewrite all links
> in XML according weblang parameter.
#!/usr/bin/perl
use strict;
use warnings;
{
local ($,,$\) = ("\t", "\n");
my $orig = "
Foo and Bars Link='
Dr.Ruud [DR], on Friday, December 9, 2005 at 12:45 (+0100) wrote:
DR> #!/usr/bin/perl
thanks a lot Dr.Ruud (not Dr.Perl?:)). It works like a charm.
I completely forget to [^morecharacters] idiom.
--
How do you protect mail on web? I use http://www.2pu.net
[I am Ryu of Borg: The pronunciation
Ing. Branislav Gerzo schreef:
> Dr.Ruud:
> thanks a lot Dr.Ruud (not Dr.Perl?:)). It works like a charm.
> I completely forget to [^morecharacters] idiom.
Your welcome. Some of my assumptions may proof to be not practible, but
I think the code is easy to adjust.
Know that there are better ways to
hello all!
I'd like to request for help with this regexp. I want match
these examples:
word word
3 word word
3 word word en
3 word word en,pt
3 word word en,pt 1cd
ok, here is regexp I wrote:
^\s*(\d{1,2}\s+)?([\w\s\+:]+)(sq|hy|ay|bs|bg|hr|cs|da|nl|en|et|fi|fr|de|gr|he|hu|zh|it|ja|kk|lv|pl|pt|pb
I have a 23,000 accounting error I have to find before 12 when my boss
comes in or one of my employees is going to get reamed. To but it
nicely.
Here our two reg expr. The first returns all the data I need except data
that starts "~MISC~".
if (/\s+(\w{4,4}00).+\s+([\d,.]+)/){ # $1 = /\w\w\w\w00
Marcelo wrote:
Which regular expression would you use to remove the and from a line like this one:
Here goes a webpage's title
Thanks a lot in advance.
Try something like:
s/<\/?title>//
Although, I can remember if < and > are special regex characters so you might need to
escape them (\< and
On Sat, 24 Jan 2004, Marcelo wrote:
> Which regular expression would you use to remove the and
> from a line like this one:
>
> Here goes a webpage's title
>
> Thanks a lot in advance.
>
Did you what that _exact_ input? I.e. always ...? If so,
that's rather easy.
$line =~ s/(.*)<\/title>
John McKown wrote:
>On Sat, 24 Jan 2004, Marcelo wrote:
>
>> Which regular expression would you use to remove the and
>> from a line like this one:
>>
>> Here goes a webpage's title
>>
>> Thanks a lot in advance.
>>
>
>Did you what that _exact_ input? I.e. always ...? If so,
>that's rather
> -Original Message-
> From: Zysman, Roiy
> Sent: Sunday, June 02, 2002 2:40 PM
> To: '[EMAIL PROTECTED]'
> Subject: regexp help
>
> Hi all
> how do i catch the last segment of a path and file name
> for example i would like
$_
$MyFilename = $1;
}
Wags ;)
-Original Message-
From: Zysman, Roiy [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 02, 2002 04:44
To: '[EMAIL PROTECTED]'
Subject: FW: regexp help
> -Original Message-
> From: Zysman, Roiy
> Se
how do i only get the first part from this?
RTFRT_flu@23460@\GE_Machine <- replica:GE_Machine_KI@\GE_Machine
i get this value in $_, now i want to remove anything that is after <- including the
arrow (what i want is: RTFRT_flu@23460@\GE_Machine) The arrow may point in the other
direction, and
On 10 May 2004, at 17:42, <[EMAIL PROTECTED]> wrote:
Well need your help in framing a RegExp
I've to parse for the tag in a HTML/ASP file and then when i
get that i need
to get only yhe action filepath in to an array ! How do i do it ?
Parse::HTML would suggest itself rather then a regex.
F
Jason Price wrote:
I'm trying to write a regular expression to divide up a line of
text into a hash, but am having a hard time with it. I'm hoping
you all can help me.
Here's an example line of text:
Not every line will have the same keys, or the same number of keys.
In that case the example you
Price, Jason (TLR Corp) wrote:
I'm trying to write a regular expression to divide up a line of text
into a hash, but am having a hard time with it. I'm hoping you all can
help me.
Here's an example line of text:
"( uiwgAttribute-OID NAME 'uiwgAttribute' DESC 'Contains meta data about
an attribute
Original Message
From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 3:46 PM
To: [EMAIL PROTECTED]
Subject: Re: RegExp help
> Jason Price wrote:
>> I'm trying to write a regular expression to divide up a line of text
>> into a hash, but a
On Jun 24, Price, Jason (TLR Corp) said:
>"( uiwgAttribute-OID NAME 'uiwgAttribute' DESC 'Contains meta data about
>an attribute' SUP top MUST cn MAY ( uiwgADsType $ uiwgDescription $
>uiwgDisplayName $ uiwgIsMultiValued ) )"
> NAME -> 'uiwgAttribute',
> DESC -> 'Contains meta data ab
On 6/24/2004 4:58 PM, Price, Jason (TLR Corp) wrote:
Original Message
From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 3:46 PM
To: [EMAIL PROTECTED]
Subject: Re: RegExp help
Jason Price wrote:
I'm trying to write a regular expression to divide up a li
Jason Price wrote:
Gunnar Hjalmarsson wrote:
Jason Price wrote:
Not every line will have the same keys, or the same number of
keys.
In that case the example you posted is obviously not sufficient
as a problem description.
Basically, every line will follow a similar pattern: "junk KEY1
value1 KEY2
Lightning flashed, thunder crashed and "Kyrytow, Stefan" <[EMAIL PROTECTED]
m> whispered:
| Example.
| I am writing a script to parse a web log and report on all the hosts in the
| log.
| However I have a command line option to exclude a domain from the report.
| My problem is that I can't figure
To: "Perl (E-mail)" <[EMAIL PROTECTED]>
On Thursday 13 December 2001 16:36, Ryan Guy wrote:
> just a simple question. I am new to the whole RegExp thing. It gets kind
> of confusing. If someone could point me in the direction of a good
> tutorial with plenty of examples or if someone could post a few regexp with
> small code snippets
To: Jon Shoberg; Beginners (E-mail)
Cc: *MySQL mail list
Subject: RE: Regexp Help !!!
> -Original Message-
> From: Jon Shoberg [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 13, 2002 4:47 PM
> To: Beginners (E-mail)
> Cc: *MySQL mail list; Jon Shoberg
> Su
; "Beginners
(E-mail)" <[EMAIL PROTECTED]>
Cc: "*MySQL mail list" <[EMAIL PROTECTED]>
Sent: Sunday, January 13, 2002 11:36 AM
Subject: RE: Regexp Help !!!
>
> Thanks !
>
> Glad I asked for some other thoughts on this. I totally over looked this
>
Jon Shoberg wrote:
>
> I have a list/database of words that follows as ...
>
> Top
> ...
> Top/Arts/Food
> Top/Arts/Food/Country
> ...
> Top/World/America
> Top/World/Japan
> Top/World/Japan/Economy
> Top/World/Japan/Food
> Top/World/Japan/Food/Country
> Top/World/Japan/Food/Country/By_C
On Mon, Feb 18, 2002 at 01:30:01PM +0100, Jorge Goncalvez wrote:
> Hi, I need some help to have a regexp which could replace : by - in this code:
my $mac=$_Globals{MAC_ADDRESS};
$mac=~s/:/-/g; # Here's the RE you were asking for
my $cmd="arp -s $ipadress $mac";
sys
On Mon, Feb 18, 2002 at 01:30:01PM +0100, Jorge Goncalvez wrote:
>> Hi, I need some help to have a regexp which could replace : by - in this
code:
> my $mac=$_Globals{MAC_ADDRESS};
$mac=~s/://; # You will need to add this to remove the leading colon
> $mac=~s/:/-/g; # Here's
Jorge Goncalvez wrote:
>
> Hi, I need some help to have a regexp which could replace : by - in this code:
>
> my $cmd="arp -s $ipadress $_Globals{MAC_ADDRESS}";
>
> system($cmd);
> actually
> $_Globals{MAC_ADDRESS} is formatted like this :XX:XX:XX:XX:XX:XX and i wanted to
> put it like this: X
Brano Gerzo schreef:
> hello all!
>
> I'd like to request for help with this regexp. I want match
> these examples:
>
> word word
> 3 word word
> 3 word word en
> 3 word word en,pt
> 3 word word en,pt 1cd
>
> ok, here is regexp I wrote:
> ^\s*(\d{1,2}\s+)?([\w\s\+:]+)
> (sq|hy|ay|bs|bg|hr|cs|da|nl|
Dr.Ruud [DR], on Thursday, July 13, 2006 at 21:05 (+0200) made these
points:
DR> I don't understand what you try to match with "[\w\s\+:]+". It matches
DR> any series of characters that belong to the character class containing
DR> [[:word:]], [[:space:]], a plus and a colon. So "a b :c" would matc
Brano Gerzo am Donnerstag, 13. Juli 2006 21:23:
[...]
> yes, my example was ambiguous sorry, for that. Here are more examples:
>
> word
> word word
> word word word
> 1 word
> 1 word word word
> 1 word en,pt,sk
> 1 word en 1cd
>
> so:
> - first digits are optional
> - then it is followed by word(s)
D. Bolliger [DB], on Thursday, July 13, 2006 at 21:48 (+0200) typed
the following:
DB> This data format is ambigous, consider:
I know, but I count with it in this case. This regexp is used only for
commands to bots, so there should be some "small" errors in parsing :)
if it passes to language,
Dr.Ruud [DR], on Thursday, July 13, 2006 at 21:05 (+0200) wrote these
comments:
as you helped me much, here is example of RE:
my $re =
'^\s*(?:(\d+)\s+)?(\w+(?:\s+\w+)*?)(?:\s+((?:sq|hy|ay|bs|bg|hr|cs|da|nl|en|et|fi|fr|de|gr|he|hu|zh|it|ja|kk|lv|pl|pt|pb|ro|ru|sr|sk|sl|es|sv|th|tr|uk|al)(?:\s*,
Brano Gerzo schreef:
> Dr.Ruud [DR], on Thursday, July 13, 2006 at 21:05 (+0200) made these
> points:
>
>> I don't understand what you try to match with "[\w\s\+:]+". It
>> matches any series of characters that belong to the character class
>> containing [[:word:]], [[:space:]], a plus and a colon.
Brano Gerzo schreef:
> Dr.Ruud [DR], on Thursday, July 13, 2006 at 21:05 (+0200) wrote these
> comments:
>
>
> as you helped me much, here is example of RE:
>
> my $re =
>
'^\s*(?:(\d+)\s+)?(\w+(?:\s+\w+)*?)(?:\s+((?:sq|hy|ay|bs|bg|hr|cs|da|nl|
en|et|fi|fr|de|gr|he|hu|zh|it|ja|kk|lv|pl|pt|pb|ro|ru|
"Dr.Ruud" schreef:
> Slight revision, that fails on the last line:
More assuming revision:
#!/usr/bin/perl
use warnings ;
use strict ;
sub SOB { '\A' }
sub EOB { '\z' }
sub OR { join '|', @_ }
sub sp { '[[:blank:]]+' }
sub capture { "(@_)" }
sub optional
-Original Message-
From: Dr.Ruud [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 13, 2006 5:24 PM
To: beginners@perl.org
Subject: Re: Regexp help please
"Dr.Ruud" schreef:
> Slight revision, that fails on the last line:
More assuming revision:
#!/usr/bin/perl
use war
Smith, Derek schreef:
> Dr.Ruud:
>> sub SOB { '\A' }
>> sub EOB { '\z' }
>
> Are all these considered anonymous sub-routines?
No, see `perldoc perlsub`.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
got it. I only need one set of () and only |.
> -Original Message-
> From: Paul Kraus [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002 9:30 AM
> To: 'Perl'
> Subject: REGEXP help asap :)
> Importance: High
>
>
> I have a 23,000 acco
> Here our two reg expr. The first returns all the data I need
> except data
> that starts "~MISC~".
>
> if (/\s+(\w{4,4}00).+\s+([\d,.]+)/){ # $1 = /\w\w\w\w00
> if (/\s+((\w{4,4}00)||~MISC~)).+\s+([\d,.]+)/){ # same
> expression but
> I need it to match if its \w\w\w\w00 or ~MISC~
Well I
At 07:44 2002.06.02, Zysman, Roiy wrote:
>> -Original Message-
>> From: Zysman, Roiy
>> Sent: Sunday, June 02, 2002 2:40 PM
>> To: '[EMAIL PROTECTED]'
>> Subject: regexp help
>>
>> Hi all
>> how do i catch the l
On Sunday, June 2, 2002, at 04:44 , Zysman, Roiy wrote:
>> Hi all
>> how do i catch the last segment of a path and file name
>> for example i would like to catch only "test.gif" in /usr/src/test.gif or
>> from /usr/src/test1/../...//test.gif
well most of use would
use File::Basenam
> how do i only get the first part from this?
>
> RTFRT_flu@23460@\GE_Machine <- replica:GE_Machine_KI@\GE_Machine
>
> i get this value in $_, now i want to remove anything that is after <- including the
>arrow >>>(what i want is:
RTFRT_flu@23460@\GE_Machine) The arrow may point in the other di
On Tue, 13 Aug 2002, David Samuelsson (PAC) wrote:
> how do i only get the first part from this?
>
> RTFRT_flu@23460@\GE_Machine <- replica:GE_Machine_KI@\GE_Machine
>
> i get this value in $_, now i want to remove anything that is after <- including the
>arrow (what i want is: RTFRT_flu@23460
On Tue, 13 Aug 2002, Connie Chan wrote:
> regex method :
> $_ =~ s/^(.+)<\-(.+)$/$1/;
1) By default the regex engine tries to match the contents of $_, so your
statement can be written as
s/^(.+)<\-(.+)$/$1/;
2) You don't have to escape '-' in this case, it assumes a special meaning
o
on Tue, 13 Aug 2002 09:01:22 GMT, [EMAIL PROTECTED]
(David Samuelsson) wrote:
> how do i only get the first part from this?
>
> RTFRT_flu@23460@\GE_Machine <- replica:GE_Machine_KI@\GE_Machine
>
> i get this value in $_, now i want to remove anything that is
> after <- including the arrow (wha
David Samuelsson wrote:
>
> how do i only get the first part from this?
>
> RTFRT_flu@23460@\GE_Machine <- replica:GE_Machine_KI@\GE_Machine
>
> i get this value in $_, now i want to remove anything that is
> after <- including the arrow (what i want is: RTFRT_flu@23460@\GE_Machine)
> The arrow
-Original Message-
From: Felix Geerinckx [mailto:[EMAIL PROTECTED]]
Sent: den 13 augusti 2002 11:56
To: [EMAIL PROTECTED]
Subject: Re: Quick regexp help!
on Tue, 13 Aug 2002 09:01:22 GMT, [EMAIL PROTECTED]
(David Samuelsson) wrote:
> how do i only get the first part from this?
>
> RTFRT_
Hi,
I am trying to use the net::telnet module, and I keep timing out. I
believe it is because I do not have the right prompt. My prompt looks like
[sqa1@duke:~]$. I do not know why this doesn't work: Prompt =>
'/\[$::username\@$::machine\]\$$/'. Any help you can give me would be
greatly ap
Hey Joe,
[EMAIL PROTECTED] wrote:
Hi Gurus !
I am not a Guru, i am a newb :-)
Well need your help in framing a RegExp
I've to parse for the tag in a HTML/ASP file and then when i get that i need
to get only yhe action filepath in to an array ! How do i do it ?
For Example
i need only th
Hello Daryl,
Saturday, January 05, 2002, Daryl J. Hoyt <[EMAIL PROTECTED]> wrote:
DJH> Hi,
DJH> I am trying to use the net::telnet module, and I keep timing out. I
DJH> believe it is because I do not have the right prompt. My prompt looks like
DJH> [sqa1@duke:~]$. I do not know why this d
William M West wrote:
>
> David Dorward wrote:
> >
> >(my $action) = ($html =~ /action=\"(.*?)\"/);
> >
> >That gives the same as my example.
>
> using parentheses to capture matches is really neat :) i
> did not know that you could do that.
It is not the parentheses per se that capture matche
Hello,
I have been using DBI::Shell (via dbish) which provides a shell prompt for
interacting with a database and I think I have come across a bug that I might be able
to fix but am having trouble doing so. I looked on CPAN and Google and was not able to
find anything beyond basic infor
I was using the First Edition of Perl in a Nutshell for reference, so I guess
things have changed a little :). That seems to work for the simple commands I am
running.
I was going to forward this to the author for their review and am wondering
what the exceptable format is? I ha
On Thu, Oct 17, 2002 at 04:23:12PM +, Robert Thompson wrote:
> I have been using DBI::Shell (via dbish) which provides a shell
> prompt for interacting with a database and I think I have come
> across a bug that I might be able to fix but am having trouble doing
> so. I
On Oct 17, Robert Thompson said:
>(?http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
what does y/// stand for? why, yansliterate of course.
[ I'm lo
70 matches
Mail list logo