Re: Regexp help please

2006-07-13 Thread Dr.Ruud
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|

Re: Regexp help please

2006-07-13 Thread Brano Gerzo
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

Re: Regexp help please

2006-07-13 Thread D. Bolliger
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)

Re: Regexp help please

2006-07-13 Thread Brano Gerzo
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,

Re: Regexp help please

2006-07-13 Thread Brano Gerzo
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*,

Re: Regexp help please

2006-07-13 Thread Dr.Ruud
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.

Re: Regexp help please

2006-07-13 Thread Dr.Ruud
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|

Re: Regexp help please

2006-07-13 Thread Dr.Ruud
"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

RE: Regexp help please

2006-07-13 Thread Smith, Derek
-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

Re: Regexp help please

2006-07-13 Thread Dr.Ruud
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