regular expression question

2005-01-17 Thread Vincent
Hi all, I am new to perl, I receive some spam email with subject like "st0ck, 0pportunities, gr0wth...", how can I match those words with number "0" in Thanks in advance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

regular expression question

2004-07-02 Thread Graeme McLaren
Afternoon all, I'm trying to to a regular expression to search and replace + with \+ I need to escape the + because it is getting used as an operator instead of a literal string, this is what I have so far: $terms[$i] =~ s/\+ /\ \\\+/g; Basically the result of searching for c++ should return re

Regular Expression question

2003-10-09 Thread Trina Espinoza
How do you create a regular expression that allows you to have files like ths: Stuff_Dev Greg_Files myThings_ _default I wrote this s/([A-Za-z]*)/\n$1/g; It only gets the letters, but I am not sure how to write in the underscore. Any attemps I have made on adding the _ get the wrong results e.

Regular Expression Question

2008-09-22 Thread Farrell, Patrick
I want to replace all instances of ~someString~ in a larger string with someString I tried the following statement: $string =~ s/\~.*\~/.*<\/i>/g; But what I get is a bunch of the following as the replacements: .* How do I retain the original .* in the replacement? Thanks -- To unsu

Regular expression question

2008-10-06 Thread irata
Hello, can someone explain me, why this short regex don't give the result I expect: perl -e '$text = "(7)   32"; printf "[%s][%s]\n", ( $text =~ /\((\d+) \)\s+(\d+)/ )' I supposed that the output is "[7][32]", but the output is "[][]". I don't know why... Regards... -- To unsubscribe, e-mail

Regular expression question

2010-08-13 Thread irata
Hi... I want to replace in a javscript structure like the one below every occurence of "{#...}", "{?...}", "{+...}" and "{=...}" through something different (also nested): function() { test1 = "{#Caption}"; test2 = "{#Te{?st}}"; test3 = "{+date.{0}}"; } with this regular e

regular expression question

2007-12-01 Thread Eric Krause
Hello all, I have a string like: 1xxx1111xx11x1 I would like to replace the 1's with the total of 1's like this: 5xxx26xx2x1 Can anyone please help? -Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.o

regular expression question

2006-09-06 Thread chen li
Hello all, I need a regular expression to process some data but get stuck. I wonder if anyone here might have a clue. input: my $line='group A 1 2 3 4';# separated by space results: my @data=("group A ",1,2,3,4); Thanks, Li __ Do You Yahoo!

Regular expression question...

2006-02-11 Thread Ley, Chung
Hi, What is the regular expression to look for "%" unless that the "\" is right before that? So, if I have something like this: "\%abc%", I like to get the 2nd "%" and not the first Thanks... --Chung

Re: regular expression question

2005-01-17 Thread Dave Gray
> I am new to perl, I receive some spam email with subject like "st0ck, > 0pportunities, gr0wth...", how can I match those words with number "0" in Something like __CODE__ use warnings; use strict; use Data::Dumper; # add to this hash to make it slower my %rep = ( 'a' => [4], 'e' => [3], '

Re: regular expression question

2005-01-17 Thread Stone
On Mon, 17 Jan 2005 16:04:48 -0500, Dave Gray <[EMAIL PROTECTED]> wrote: > > I am new to perl, I receive some spam email with subject like "st0ck, > > 0pportunities, gr0wth...", how can I match those words with number "0" in What about something like this: if ( $subject =~ /(^0[a-zA-Z]+)|([a-zA-Z

Re: regular expression question

2005-01-17 Thread Chris Devers
On Mon, 17 Jan 2005, Vincent wrote: > I am new to perl, I receive some spam email with subject like "st0ck, > 0pportunities, gr0wth...", how can I match those words with number "0" > in You don't. I spent a about a year doing pretty much what you're asking for here, though with Procmail rules

Another regular expression question?

2001-04-20 Thread Yvonne Murphy
I am also very new to Perl! I need to figure out how I could skip a block of comments in a C header file. For example, if I have something like the following: /* This is my block of comments.blah blah.and lots more commen

Re: regular expression question

2004-07-02 Thread Gunnar Hjalmarsson
Graeme McLaren wrote: Afternoon all, I'm trying to to a regular expression to search and replace + with \+ I need to escape the + because it is getting used as an operator instead of a literal string, this is what I have so far: $terms[$i] =~ s/\+ /\ \\\+/g; Basically the result of searching for c+

Re: Regular Expression question

2003-10-09 Thread Jeff Westman
Trina Espinoza <[EMAIL PROTECTED]> wrote: > How do you create a regular expression that allows you to have files like > ths: > Stuff_Dev > Greg_Files > myThings_ > _default > > I wrote this > > s/([A-Za-z]*)/\n$1/g; Your expression above only asked to get the letters :) You specified a chara

RE: Regular Expression question

2003-10-09 Thread Dan Muey
> I wrote this > > > s/([A-Za-z]*)/\n$1/g; Try this: s/\W//g; \w matches letters number and underscores \W matches anythgiin not letters numbers or underscores. Take a look at tr also it may be able to help you out. HTH Dmuey > > > It only gets the letters, but I am not sure how to wr

RE: Regular Expression question

2003-10-09 Thread Hanson, Rob
Rob -Original Message- From: Trina Espinoza [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 4:11 PM To: [EMAIL PROTECTED] Subject: Regular Expression question How do you create a regular expression that allows you to have files like ths: Stuff_Dev Greg_Files myThings_ _defa

Re: Regular Expression question

2003-10-09 Thread James Edward Gray II
On Thursday, October 9, 2003, at 03:43 PM, Dan Muey wrote: I wrote this s/([A-Za-z]*)/\n$1/g; Try this: s/\W//g; That looks like a capital W to me, though your explanation used the correct w. \W matches any NON-word character and thus wouldn't work here. James -- To unsubscribe, e-mail: [E

Re: Regular Expression Question

2008-09-22 Thread Rob Coops
You are almost there but not quite... $string =~ s/\~(.*)\~/$1<\/i>/g; Should do the trick. All I do is capture the "someString" part and rewrite it (it is stored in $1 for the first capture and $2 for the second and so on..) This way ~anystring~ will be replaced with anyString There is one more

Re: Regular Expression Question

2008-09-22 Thread Rob Dixon
Rob Coops wrote: > > You are almost there but not quite... [snip] I despair of saying this. Please bottom-post your replies (i.e. beneath the text that you are quoting.) Top-posting is fine for a short thread, but it gets to be an unintelligible mess if there are several replies. Bottom-posting

Re: Regular Expression Question

2008-09-22 Thread Raymond Wan
Dear Rob, Rob Dixon wrote: Rob Coops wrote: You are almost there but not quite... [snip] I despair of saying this. Please bottom-post your replies (i.e. beneath the text that you are quoting.) Top-posting is fine for a short thread, but it gets to be an unintelligible mess if there

RE: Regular Expression Question

2008-09-22 Thread Thomas Bätzler
Raymond Wan <[EMAIL PROTECTED]> wrote: > I looked a bit for some etiquette list for this mailing list > and couldn't find out. Perhaps it's out there somewhere? You could argue that in absence of any other rules, RFC 1855 applies: "If you are sending a reply to a message or a posting be sure yo

Re: Regular Expression Question

2008-09-22 Thread Jack Gates
On Monday 22 September 2008 08:18:27 am Rob Dixon wrote: > Thomas Bätzler wrote: > > Raymond Wan <[EMAIL PROTECTED]> wrote: > >> I looked a bit for some etiquette list for this mailing list > >> and couldn't find out. Perhaps it's out there somewhere? > > > > You could argue that in absence of any

Re: Regular Expression Question

2008-09-22 Thread Rob Dixon
Thomas Bätzler wrote: > > Raymond Wan <[EMAIL PROTECTED]> wrote: >> >> I looked a bit for some etiquette list for this mailing list >> and couldn't find out. Perhaps it's out there somewhere? > > You could argue that in absence of any other rules, RFC 1855 applies: > > "If you are sending a rep

Re: Regular Expression Question

2008-09-22 Thread Mr. Shawn H. Corey
On Mon, 2008-09-22 at 08:31 -0400, Jack Gates wrote: > Would you want to come along later and have to scroll to the bottom to > read > the first post. Scroll down a little as you read then scroll up to > read the > reply etc., etc., etc. until you are back at the top? > Funny that blogs work th

Re: Regular Expression Question

2008-09-22 Thread Jack Gates
On Monday 22 September 2008 08:42:51 am Mr. Shawn H. Corey wrote: > On Mon, 2008-09-22 at 08:31 -0400, Jack Gates wrote: > > Would you want to come along later and have to scroll to the bottom to > > read > > the first post. Scroll down a little as you read then scroll up to > > read the > > reply

Re: Regular Expression Question

2008-09-22 Thread Rob Coops
On Mon, Sep 22, 2008 at 2:48 PM, Jack Gates <[EMAIL PROTECTED]> wrote: > On Monday 22 September 2008 08:42:51 am Mr. Shawn H. Corey wrote: > > On Mon, 2008-09-22 at 08:31 -0400, Jack Gates wrote: > > > Would you want to come along later and have to scroll to the bottom to > > > read > > > the firs

Re: Regular Expression Question

2008-09-22 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > On Mon, 2008-09-22 at 08:31 -0400, Jack Gates wrote: >> Would you want to come along later and have to scroll to the bottom to >> read >> the first post. Scroll down a little as you read then scroll up to >> read the >> reply etc., etc., etc. until you are back at the

Re: Regular Expression Question

2008-09-22 Thread Rob Dixon
Rob Coops wrote: > > Ok, ok, I get it. it will not happen again, sorry all. > > :-) It's fine. I asked the same question about four years ago. People get heated about it because it is very plainly the right way to do things but we get weary of saying it over and over again. Same goes for chompin

Re: Regular Expression Question

2008-09-22 Thread Rob Dixon
Raymond Wan wrote: > > Rob Dixon wrote: >> >> Rob Coops wrote: >> >>> You are almost there but not quite... >>> >> [snip] >> >> I despair of saying this. >> >> Please bottom-post your replies (i.e. beneath the text that you are quoting.) >> Top-posting is fine for a short thread, but it ge

Re: Regular Expression Question

2008-09-22 Thread Paul Johnson
On Mon, Sep 22, 2008 at 02:52:17PM +0100, Rob Dixon wrote: > There are people who oversee this list. The shame is they let pretty much > everything by, in fact I haven't seen an intervention in the last year. The FAQ is at http://learn.perl.org/faq/beginners.html As you can see, it hasn't been u

Re: Regular Expression Question

2008-09-22 Thread Raymond Wan
Hi Rob, Rob Dixon wrote: Raymond Wan wrote: Rob Dixon wrote: Rob Coops wrote: I don't mean to sound disrespectful since you're far more helpful to this list than I am -- so, I mean this in the nicest possible way, but I genuinely would like to know -- where does it say th

Re: Regular expression question

2008-10-06 Thread Olteanu Eugen
It looks there is a space there.. # perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~ /\((\d+) \)\s+(\d+)/ )' [][] # perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~ /\((\d+)\)\s+(\d+)/ )' [7][32] On Mon, Oct 6, 2008 at 2:51 PM, irata <[EMAIL PROTECTED]> wrote: > Hello,

Re: Regular expression question

2008-10-06 Thread Mr. Shawn H. Corey
On Mon, 2008-10-06 at 04:51 -0700, irata wrote: > perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~ /\((\d+) > \)\s+(\d+)/ )' $ perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~ /\((\d+) > \)\s+(\d+)/ )' [][] $ perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~

Re: Regular expression question

2008-10-07 Thread Rob Dixon
irata wrote: > > can someone explain me, why this short regex don't give the result I > expect: > > perl -e '$text = "(7) 32"; printf "[%s][%s]\n", ( $text =~ /\((\d+) > \)\s+(\d+)/ )' > > I supposed that the output is "[7][32]", but the output is "[][]". I > don't know why... Your regular e

Re: Regular expression question

2010-08-13 Thread Jim Gibson
On 8/13/10 Fri Aug 13, 2010 1:47 PM, "irata" scribbled: > Hi... > > I want to replace in a javscript structure like the one below every > occurence of "{#...}", "{?...}", "{+...}" and "{=...}" through > something different (also nested): Check out the Text::Balanced module, available at CPAN:

Re: Regular expression question

2010-08-14 Thread C.DeRykus
On Aug 13, 1:47 pm, tobias.wage...@googlemail.com (irata) wrote: > > I want to replace in a javscript structure like the one below every > occurence of "{#...}", "{?...}", "{+...}" and "{=...}" through > something different (also nested): >    function() { >       test1 = "{#Caption}"; >       tes

Re: Regular expression question

2010-08-14 Thread C.DeRykus
On Aug 14, 6:28 am, dery...@gmail.com ("C.DeRykus") wrote: > On Aug 13, 1:47 pm, tobias.wage...@googlemail.com (irata) wrote: > > > > > > > I want to replace in a javscript structure like the one below every > > occurence of "{#...}", "{?...}", "{+...}" and "{=...}" through > > something different

Re: regular expression question

2007-12-01 Thread Tom Phoenix
On 12/1/07, Eric Krause <[EMAIL PROTECTED]> wrote: > I have a string like: > 1xxx1111xx11x1 > > I would like to replace the 1's with the total of 1's like this: > 5xxx26xx2x1 Hmmm Smells like homework. What have you tried so far? Your missing pieces of the puzzle may

Re: regular expression question

2007-12-01 Thread John W . Krahn
On Saturday 01 December 2007 18:16, Eric Krause wrote: > > Hello all, Hello, > I have a string like: > 1xxx1111xx11x1 > > I would like to replace the 1's with the total of 1's like this: > 5xxx26xx2x1 $ perl -le' $_ = q[1xxx1111xx11x1]; print; s/(1+)/@{[(

Re: regular expression question

2007-12-02 Thread Eric Krause
$ perl -le' $_ = q[1xxx1111xx11x1]; print; s/(1+)/@{[($l=$1)=~y|1|1|]}/g; print; ' 1xxx1111xx11x1 5xxx26xx2x1 :-) John John, That worked perfectly! Thanks!!! Cheers, Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: regular expression question

2007-12-02 Thread Eric Krause
Thanks Tom. It's not homework. I'm trying to parse html chess notation from a site into FEN. I labeled the blank spaces 1, now I need to add them up wherever they occur. Just for fun. What I have tried failed miserably and I'm not sure why. for ($n = 8; $n <=1; $n--) { if ($temp =

Re: regular expression question

2007-12-02 Thread Dr.Ruud
John W . Krahn schreef: > Eric Krause: >> I have a string like: >> 1xxx1111xx11x1 >> >> I would like to replace the 1's with the total of 1's like this: >> 5xxx26xx2x1 > > > $ perl -le' > $_ = q[1xxx1111xx11x1]; > print; > s/(1+)/@{[($l=$1)=~y|1|1|]}/g; >

Re: regular expression question

2007-12-02 Thread Paul Johnson
On Sun, Dec 02, 2007 at 12:14:58AM -0500, Eric Krause wrote: >> $ perl -le' >> $_ = q[1xxx1111xx11x1]; >> print; >> s/(1+)/@{[($l=$1)=~y|1|1|]}/g; >> print; >> ' >> 1xxx1111xx11x1 >> 5xxx26xx2x1 >> >> >> >> :-) >> >> John >> > John, > That worked perfectl

Re: regular expression question

2007-12-02 Thread Tom Phoenix
On 12/1/07, Eric Krause <[EMAIL PROTECTED]> wrote: >for ($n = 8; $n <=1; $n--) { $n <= 1? Because using the three-part for loop can be error-prone, in Perl we more often use the foreach loop, which is easier to get right on the first try: foreach my $n (reverse 1..8) { ... } Hope th

Re: regular expression question

2007-12-02 Thread Rob Dixon
Eric Krause wrote: > Hello all, I have a string like: 1xxx1111xx11x1 I would like to replace the 1's with the total of 1's like this: 5xxx26xx2x1 Can anyone please help? Simply: $string =~ s/(1+)/length $1/ge; HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: regular expression question

2007-12-05 Thread Perl WANNABE
* Dr.Ruud <[EMAIL PROTECTED]> [2007-12-02 14:34]: > John W . Krahn schreef: > > Eric Krause: > > > $ perl -le' > > $_ = q[1xxx1111xx11x1]; > > print; > > s/(1+)/@{[($l=$1)=~y|1|1|]}/g; > > print; > > ' > > 1xxx1111xx11x1 > > 5xxx26xx2x1 > > :-) > > Aiaiaiai

Re: regular expression question

2007-12-05 Thread John W . Krahn
On Wednesday 05 December 2007 09:53, Perl WANNABE wrote: > * Dr.Ruud <[EMAIL PROTECTED]> [2007-12-02 14:34]: > > John W . Krahn schreef: > > > Eric Krause: > > > > > > $ perl -le' > > > $_ = q[1xxx1111xx11x1]; > > > print; > > > s/(1+)/@{[($l=$1)=~y|1|1|]}/g; > > > print; > > > ' >

Re: regular expression question

2006-09-06 Thread Adriano Ferreira
On 9/6/06, chen li <[EMAIL PROTECTED]> wrote: I need a regular expression to process some data but get stuck. I wonder if anyone here might have a clue. input: my $line='group A 1 2 3 4';# separated by space results: my @data=("group A ",1,2,3,4); You barely need a regular expression for

Re: regular expression question

2006-09-06 Thread chen li
--- Adriano Ferreira <[EMAIL PROTECTED]> wrote: > On 9/6/06, chen li <[EMAIL PROTECTED]> wrote: > > I need a regular expression to process some data > but > > get stuck. I wonder if anyone here might have a > clue. > > > > input: > > my $line='group A 1 2 3 4';# separated by space > > > > res

Re: regular expression question

2006-09-06 Thread Mumia W.
On 09/06/2006 09:49 PM, chen li wrote: Hello all, I need a regular expression to process some data but get stuck. I wonder if anyone here might have a clue. input: my $line='group A 1 2 3 4';# separated by space results: my @data=("group A ",1,2,3,4); As Adriano Ferreira said, you don

Re: regular expression question

2006-09-06 Thread David Romano
chen li wrote on Wed, Sep 06, 2006 at 08:23:42PM PDT: > --- Adriano Ferreira <[EMAIL PROTECTED]> wrote: > > On 9/6/06, chen li <[EMAIL PROTECTED]> wrote: > > > I need a regular expression to process some data > > but > > > get stuck. I wonder if anyone here might have a > > clue. > > > > > > input

Re: regular expression question

2006-09-07 Thread Rob Dixon
Adriano Ferreira wrote: > > On 9/6/06, chen li <[EMAIL PROTECTED]> wrote: > >> I need a regular expression to process some data but >> get stuck. I wonder if anyone here might have a clue. >> >> input: >> my $line='group A 1 2 3 4';# separated by space >> >> results: >> my @data=("group A ",1,

Re: regular expression question

2006-09-07 Thread Rob Dixon
chen li wrote: > > I need a regular expression to process some data but > get stuck. I wonder if anyone here might have a clue. > > input: > my $line='group A 1 2 3 4';# separated by space > > results: > my @data=("group A ",1,2,3,4); My offering: my @data = $line =~ /\S+/g; splice @data

Re: regular expression question

2006-09-07 Thread Adriano Ferreira
On 9/7/06, Rob Dixon <[EMAIL PROTECTED]> wrote: It's very bad form to post something to the list that simply doesn't work. This won't even compile: Type of arg 1 to shift must be array (not concatenation (.) or string) at E:\Perl\source\xx.pl line 2, near "" ")" Ok, my fault. I was hasty to

Re: regular expression question

2006-09-07 Thread chen li
> On 9/7/06, chen li <[EMAIL PROTECTED]> wrote: > > Hi Adriano, > > > > The line code you provide doesn't work on my > computer > > but based on what you say I change it into this > line > > code and it works. > > > On 9/7/06, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Why did I have to test this c

Re: regular expression question

2006-09-08 Thread chen li
--- David Romano <[EMAIL PROTECTED]> wrote: > chen li wrote on Thu, Sep 07, 2006 at 01:13:04PM > PDT: > > > > > One more question what if I have a file that > have > > > > different lines 1) some lines have number only > 2) > > > some > > > > lines have more than 2 words at the begining? > > >

Re: regular expression question

2006-09-08 Thread David Romano
chen li wrote on Fri, Sep 08, 2006 at 09:34:03AM PDT: > One more question about this regex: > > @data = m/(\D+[^\d\s]|\d+)/g; > > I check Programming Perl or perldoc they say ^ is used > as an anchor meaning "start/begining with". But here > looks like it has a different usage. Is that right? Yes

Newbie Regular expression question

2005-04-05 Thread N. Ganesh Babu
Dear All, I have to convert these lines into individual part of name information with a single regular expression. Input: B. E. Conway, J. O. M. Bockris B. Conway Output: B.E.Conway J.O. M. Bockris B. Conway Can anybody help me in getting the single regular expression. Thanks for the help. Rega

Re: Regular expression question...

2006-02-12 Thread Chas Owens
On 2/12/06, Ley, Chung <[EMAIL PROTECTED]> wrote: > Hi, > > What is the regular expression to look for "%" unless that the "\" is right > before that? > > So, if I have something like this: > "\%abc%", I like to get the 2nd "%" and not the first > > Thanks... > > --Chung Your first resource f

RE: Another regular expression question?

2001-04-20 Thread Amarnath Honnavalli Anantharamaiah
CTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 1:33 PM To: [EMAIL PROTECTED] Subject: Another regular expression question? I am also very new to Perl! I need to figure out how I could skip a block of comments in a C header file. For example, if I have something like the foll

RE: Another regular expression question?

2001-04-20 Thread bbking
[EMAIL PROTECTED] said... > I don't know how this works, But I have seen this regexp comparison it in > perlop man pages. It has been very good regexp. > Can anyone explain this for me. I'll add some comments that may help explain some of what was left out: #! /usr/bin/perl # open the file op

RE: Another regular expression question?

2001-04-22 Thread King, Jason
jason king In Spearfish, South Dakota, if three or more Indians are walking down the street together, they can be considered a war party and fired upon. - http://dumblaws.com/ >-Original Message- >From: Amarnath Honnavalli Anantharamaiah >[mailto:[EMAIL PROTECTED]] >Se

RE: Another regular expression question?

2001-04-24 Thread Amarnath Honnavalli Anantharamaiah
"=~ s" as delimiter Regards, Amar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 5:39 PM To: [EMAIL PROTECTED] Subject: RE: Another regular expression question? [EMAIL PROTECTED] said... > I don't know how

RE: Another regular expression question?

2001-04-24 Thread Amarnath Honnavalli Anantharamaiah
Thanks for the range operator idea. -Original Message- From: King, Jason [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 4:29 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject:RE: Another regular expression question? Amarnath's code sample below c

RE: Another regular expression question?

2001-04-25 Thread King, Jason
//. But do we have to specify in particular what is the >delimiter Or does >it take by default any charecter next to "=~ s" as delimiter > >Regards, >Amar > > >-Original Message- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] >Sent: Friday, April

Re: Another regular expression question?

2001-08-17 Thread Walnut
Suck the file into a single variable and: $entirefile =~ s!\/\*.*?\*\/!!g; On Fri, 20 Apr 2001 09:03:29 +0100, [EMAIL PROTECTED] (Yvonne Murphy) wrote: >I am also very new to Perl! I need to figure out how I could skip a >block of comments in a C header file. For example, if I have something

Re: Another regular expression question?

2001-08-20 Thread Curtis Poe
--- Walnut <[EMAIL PROTECTED]> wrote: > Suck the file into a single variable and: > > $entirefile =~ s!\/\*.*?\*\/!!g; > > >I am also very new to Perl! I need to figure out how I could skip a > >block of comments in a C header file. For example, if I have something > >like the following: > > > >/

RE: Another regular expression question?

2001-08-20 Thread Bob Showalter
> -Original Message- > From: Curtis Poe [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 20, 2001 10:29 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Another regular expression question? > > ... > 2. Oftimes, a programmer will comment out an enti

Re: Newbie Regular expression question

2005-04-05 Thread John W. Krahn
N. Ganesh Babu wrote: Dear All, Hello, I have to convert these lines into individual part of name information with a single regular expression. Input: B. E. Conway, J. O. M. Bockris B. Conway Output: B.E.Conway J.O. M. Bockris B. Conway Can anybody help me in getting the single regular expressi

Re: Newbie Regular expression question

2005-04-07 Thread N. Ganesh Babu
Dear John, Thank you very much for you help. One more small help. fourth string B. van Sures to be tagged as B.van Sures fifth string van Sures, B., to be tagged as van SuresB. sixth string Bockris, O. M. J., to be tagged as BockrisO. M.J. All 6 should be converted in a single regex. Regards, G

Re: Newbie Regular expression question

2005-04-08 Thread John W. Krahn
N. Ganesh Babu wrote: Thank you very much for you help. One more small help. fourth string B. van Sures to be tagged as B.van Sures fifth string van Sures, B., to be tagged as van SuresB. sixth string Bockris, O. M. J., to be tagged as BockrisO. M.J. All 6 should be converted in a single rege

Re: Newbie Regular expression question

2005-04-08 Thread N. Ganesh Babu
Hi John, I am new to understanding and how to use modules in perl programs. I have downloaded and installed the Modules you specified. The documentation in that I can not able to understand. Can you please help with a sample code. Thanks in advance. Regards, Ganesh John W. Krahn wrote: N. Ganes

Re: Newbie Regular expression question

2005-04-08 Thread John W. Krahn
N. Ganesh Babu wrote: Hi John, Hello, I am new to understanding and how to use modules in perl programs. I have downloaded and installed the Modules you specified. The documentation in that I can not able to understand. Can you please help with a sample code. I'm sorry, I haven't used that modul

Regular expression question: non-greedy matches

2004-04-04 Thread Boris Shor
Hello, Perl beginner here. I am having difficulty with a regular expression that uses non-greedy matches. Here is a sample code snippet: $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) { print "$1\n"; print "$2\n"; } The

Re: Regular expression question: non-greedy matches

2004-04-04 Thread Randy W. Sims
Boris Shor wrote: Hello, Perl beginner here. I am having difficulty with a regular expression that uses non-greedy matches. Here is a sample code snippet: $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) { print "$1\n"; print "

Re: Regular expression question: non-greedy matches

2004-04-04 Thread R. Joseph Newton
Boris Shor wrote: > Hello, > > Perl beginner here. I am having difficulty with a regular expression > that uses non-greedy matches. Here is a sample code snippet: > > $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; > while ($test =~ /Yea (.*?)x.*?(?:Nay (.*?)x)?/g) You have your non-capturing

RE: Regular expression question: non-greedy matches

2004-04-05 Thread Boris Shor
this, I get no matches on the 'nays' or $2. -Original Message- From: Randy W. Sims [mailto:[EMAIL PROTECTED] Sent: Sunday, April 04, 2004 9:30 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Regular expression question: non-greedy matches Boris Shor wrote: > H

FW: Regular expression question: non-greedy matches

2004-04-05 Thread Boris Shor
Thanks for writing. I get no warnings when I use (ActiveState Perl on Windows): use Strict; use Warnings; $test = "Yea 123xrandomYea 456xdumdumNay 789xpop"; while ($test =~ /Yea (.*?)x.*?(Nay (.*?)x)?/g) { print "$1\n"; print "$2\n"; } What I am looking for are pairs: $1

Re: Regular expression question: non-greedy matches

2004-04-05 Thread R. Joseph Newton
Boris Shor wrote: > Thanks for writing. Hi Boris, Please don't top-post. It makes it very difficult to get the context of your message. Istead, post following the material to which you are responding. > Your code works for this example but doesn't get exactly > what I need. It's important to

RE: Regular expression question: non-greedy matches

2004-04-21 Thread Boris Shor
'Stuart > V. Jordan' > Subject: Re: Regular expression question: non-greedy matches > > > That is a bit off. I think we really need a sample of actual > data to be able to help you. If the data is of a > confidential nature, then you will have to do meaningful

RE: List Etiquette (WAS: Regular Expression Question)

2008-09-22 Thread Mr. Shawn H. Corey
On Mon, 2008-09-22 at 14:03 +0200, Thomas Bätzler wrote: > Raymond Wan <[EMAIL PROTECTED]> wrote: > > I looked a bit for some etiquette list for this mailing list > > and couldn't find out. Perhaps it's out there somewhere? > > You could argue that in absence of any other rules, RFC 1855 applies

Re: List Etiquette (WAS: Regular Expression Question)

2008-09-22 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > On Mon, 2008-09-22 at 14:03 +0200, Thomas Bätzler wrote: >> Raymond Wan <[EMAIL PROTECTED]> wrote: >>> I looked a bit for some etiquette list for this mailing list >>> and couldn't find out. Perhaps it's out there somewhere? >> You could argue that in absence of any ot

Quoting Style meta-discussion & religious war (was RE: Regular Expression Question)

2008-09-22 Thread Thomas Bätzler
Mr. Shawn H. Corey <[EMAIL PROTECTED]> sniped with regard to top-posting: > Funny that blogs work that way. Do they now? The ones that I tend to read all show the comment section after the article body. Cheers, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Quoting Style meta-discussion & religious war (was RE: Regular Expression Question)

2008-09-22 Thread Raymond Wan
Hi Thomas, Thomas Bätzler wrote: Mr. Shawn H. Corey <[EMAIL PROTECTED]> sniped with regard to top-posting: Funny that blogs work that way. Do they now? The ones that I tend to read all show the comment section after the article body. I think that depends on the software. I kno