Re: regex question

2010-07-08 Thread Dr.Ruud
Shlomi Fish wrote: On Friday 02 Jul 2010 17:29:27 Dr.Ruud wrote: sdDirtySox wrote: I want to use a perl script that will look at all the files in a directory to find an instance of a function and replace it with another. I have the code in place to look at all the files in a directory and to

Re: regex question

2010-07-06 Thread Shlomi Fish
On Friday 02 Jul 2010 17:29:27 Dr.Ruud wrote: > sdDirtySox wrote: > > I want to use a perl script that will look at all the files in a > > directory to find an instance of a function and replace it with > > another. I have the code in place to look at all the files in a > > directory and to search

Re: regex question

2010-07-04 Thread Bo Jangles
Thanks for responding. I'll give it a try. On Jul 2, 5:10 am, jwkr...@shaw.ca ("John W. Krahn") wrote: > sdDirtySox wrote: > > Hi all, > > Hello, > > > I want to use a perl script that will look at all the files in a > > directory to find an instance of a function and replace it with > > another.

Re: regex question

2010-07-04 Thread Dr.Ruud
sdDirtySox wrote: I want to use a perl script that will look at all the files in a directory to find an instance of a function and replace it with another. I have the code in place to look at all the files in a directory and to search line by line, but I'm having problems with the regex to use.

Re: regex question

2010-07-02 Thread John W. Krahn
sdDirtySox wrote: Hi all, Hello, I want to use a perl script that will look at all the files in a directory to find an instance of a function and replace it with another. I have the code in place to look at all the files in a directory and to search line by line, but I'm having problems with

Re: Regex question

2010-03-24 Thread Dr.Ruud
Bruce Ferrell wrote: if ( ! defined $username || ! $username =~ /[0-9]{10,11}/ ) { do something; } else { do something else; } if ( $username and $username =~ /\A[0-9]{10,11}\z/ ) { ...; } else { die; } -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@p

Re: Regex question

2010-03-24 Thread trapd00r
On 24/03/10 00:13 -0700, Bruce Ferrell wrote: if ( ! defined $username || ! $username =~ /[0-9]{10,11}/ ) { do something; } else { do something else; } what that's supposed to do is this: if it's blank or not 10 or 11 digits... The question is where is my understanding faulty or did I mess

Re: regex question

2009-12-22 Thread John W. Krahn
Parag Kalra wrote: You can try following: $_ =~ s/^\.(\s)+//g; You are using capturing parentheses but you are not using the results of that capture anywhere so why use them? You are using capturing parentheses in LIST context so even if there are multiple whitespace characters you are onl

Re: regex question

2009-12-22 Thread Parag Kalra
Thanks Philip for sharing this excellent piece of information. Cheers, Parag On Tue, Dec 22, 2009 at 8:17 PM, Philip Potter wrote: > 2009/12/22 Parag Kalra : > > You can try following: > > > > $_ =~ s/^\.(\s)+//g; > > This isn't quite right. > > There are two ways in which you might use this

Re: regex question

2009-12-22 Thread Shawn H Corey
Philip Potter wrote: > 2009/12/22 Parag Kalra : >> You can try following: >> >> $_ =~ s/^\.(\s)+//g; > > This isn't quite right. > > There are two ways in which you might use this substitution: either $_ > will contain a single line, or it will contain multiple lines. The > single line case might

Re: regex question

2009-12-22 Thread Philip Potter
2009/12/22 Parag Kalra : > You can try following: > > $_ =~ s/^\.(\s)+//g; This isn't quite right. There are two ways in which you might use this substitution: either $_ will contain a single line, or it will contain multiple lines. The single line case might look something like this: while (<>)

Re: regex question

2009-12-22 Thread Parag Kalra
You can try following: $_ =~ s/^\.(\s)+//g; Cheers, Parag On Tue, Dec 22, 2009 at 10:59 AM, Jim Green wrote: > Hi, > > I have a text file with lines like this > > > · Experience in C/C++ realtime system programming > > · Experience in ACE, FIX > > > Could anybody tell me whic

Re: regex question

2009-12-21 Thread Jim Green
2009/12/22 Jim Gibson : > s/^\.\s*//; Thanks Jim, I will figure out as I read "learning perl". > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- To unsubscribe, e-mail: beginners-unsubscr

Re: regex question

2009-12-21 Thread Jim Gibson
At 11:49 PM -0600 12/21/09, Jim Green wrote: Hi, I have a text file with lines like this · Experience in C/C++ realtime system programming · Experience in ACE, FIX Could anybody tell me which regex to use to get rid of the dot and the leading spaces before each Line? s/^\.

Re: regex question

2009-12-21 Thread Jim Green
2009/12/21 Uri Guttman : >> "JG" == Jim Green writes: > >  JG> I have a text file with lines like this > > >  JG> ·         Experience in C/C++ realtime system programming > >  JG> ·         Experience in ACE, FIX > > >  JG> Could anybody tell me which regex to use to get rid of the dot and th

Re: regex question

2009-12-21 Thread Uri Guttman
> "JG" == Jim Green writes: JG> I have a text file with lines like this JG> · Experience in C/C++ realtime system programming JG> · Experience in ACE, FIX JG> Could anybody tell me which regex to use to get rid of the dot and the JG> leading spaces before each L

Re: regex question

2009-11-11 Thread Jeremiah Foster
On Nov 9, 2009, at 16:25, axr0284 wrote: > Hi, > I am completely stumped with how to proceed with this. > I have a program where the user inputs a path to a file. This is under > windows xp > > The path can be relative > ..\..\..\synthesis\int_code.psm > .\program\synthesis\int_code.psm > > or

Re: regex question

2009-11-09 Thread Jay Savage
On Mon, Nov 9, 2009 at 10:25 AM, axr0284 wrote: > Hi, >  I am completely stumped with how to proceed with this. > I have a program where the user inputs a path to a file. This is under > windows xp > > The path can be relative > ..\..\..\synthesis\int_code.psm > .\program\synthesis\int_code.psm >

Re: regex question

2009-09-15 Thread Uri Guttman
> "GM" == Gregory Machin writes: GM> Thanks for the help .. knowing the anchor thing help me. if you not GM> sure what ur looking for or what it call you end up with the wrong GM> thing. did you read my post? if you had a clue about the digits starting at the beginning of the string, t

Re: regex question

2009-09-15 Thread Gregory Machin
Thanks for the help .. knowing the anchor thing help me. if you not sure what ur looking for or what it call you end up with the wrong thing. On Tue, Sep 15, 2009 at 10:21 AM, Tim Bowden wrote: > On Tue, 2009-09-15 at 10:10 +0200, Gregory Machin wrote: >> Any numbers, but only 3 digits in the str

Re: regex question

2009-09-15 Thread Tim Bowden
On Tue, 2009-09-15 at 10:10 +0200, Gregory Machin wrote: > Any numbers, but only 3 digits in the string. > > I'm filtering out local extention numbers from phone numbers > > Where in the log the extension is 104 and the phone number would be > something like PSTN0/2-0115070545. All the stuff I ha

Re: regex question

2009-09-15 Thread Gregory Machin
Any numbers, but only 3 digits in the string. I'm filtering out local extention numbers from phone numbers Where in the log the extension is 104 and the phone number would be something like PSTN0/2-0115070545. All the stuff I have tried have returned would return both the extension number and 3

Re: regex question

2009-09-15 Thread Tim Bowden
On Tue, 2009-09-15 at 09:30 +0200, Gregory Machin wrote: > Hi > > I'm look for code example that will only select a string containing 3 > digits .. The string cant be less than 3 digit , can't be more than 3 > and can't contain any other characters. > > I have googled and found code that will fin

Re: regex question

2009-09-15 Thread Uri Guttman
> "GM" == Gregory Machin writes: GM> I'm look for code example that will only select a string containing 3 GM> digits .. The string cant be less than 3 digit , can't be more than 3 GM> and can't contain any other characters. that is called containing exactly three digits. you spent way

anagrams (was: Re: Regex question.)

2008-07-05 Thread Dr.Ruud
Gunwant Singh schreef: > I have a query regarding regexes. No, you don't. > I am to match only one specific word in a wordlist which has only > those alphabets which it contains and none other than that. To do that, you can use regexes, but you don't need to. > My Wordlist contains: > > alph

Re: regex question matching dates

2008-05-29 Thread Richard Lee
John W. Krahn wrote: } elsif ( $ARGV[0] =~ m/\b2008(0[1-9]|1[12])(0[1-9]|1[0-9]|2[0-9]|3[01])([01][0-9]|2[0-3])\b/ ) { ^ So you don't want to test for October? John fixed now. thanks!! } elsif ( $ARGV[0] =~ m/\b2008(0[1-9]|1[012])(0[1-9]|1[0-9]|2[0-9]|3[01])([01][

Re: regex question matching dates

2008-05-28 Thread John W. Krahn
Richard Lee wrote: John W. Krahn wrote: Richard Lee wrote: given then ARGV[0] is 2008052803, why woulnd't below regex match them?? 2008052803 is a ten digit number. } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { Your pattern matches eight digits with a \b word boundary

Re: regex question matching dates

2008-05-28 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: given then ARGV[0] is 2008052803, why woulnd't below regex match them?? 2008052803 is a ten digit number. } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { Your pattern matches eight digits with a \b word boundary at each end so it

Re: regex question matching dates

2008-05-28 Thread John W. Krahn
John W. Krahn wrote: Richard Lee wrote: @array = qx#ls -tr $directory/$ARGV[0]*#; Why not do that directly in perl: @array = map $_->[0], sort { $a->[1] <=> $b->[1] } map [ $_, -M ], glob "$directory/$ARGV[0]*"; Sorry, that should be: @array = map $_->[0], sort { $b->[1] <

Re: regex question matching dates

2008-05-28 Thread John W. Krahn
Richard Lee wrote: given then ARGV[0] is 2008052803, why woulnd't below regex match them?? 2008052803 is a ten digit number. } elsif ( $ARGV[0] =~ m/\b2008[01][1-31]([01][0-9]|2[0-3])\b/ ) { Your pattern matches eight digits with a \b word boundary at each end so it will never match a ten

Re: regex question

2008-04-25 Thread David Nicholas Kayal
Thank you. On Fri, 25 Apr 2008, J. Peng wrote: On Fri, Apr 25, 2008 at 12:47 AM, David Nicholas Kayal <[EMAIL PROTECTED]> wrote: why is the first one true? check 'perldoc perlre' : The following standard quantifiers are recognized: * Match 0 or more times \d* me

Re: regex question

2008-04-25 Thread J. Peng
On Fri, Apr 25, 2008 at 12:47 AM, David Nicholas Kayal <[EMAIL PROTECTED]> wrote: > > why is the first one true? > check 'perldoc perlre' : The following standard quantifiers are recognized: * Match 0 or more times \d* means 0 or more numbers. -- J. Peng - QQMail Op

Re: regex question

2007-05-15 Thread rob . dixon
John W. Krahn writes: Tom Allison wrote: How do I pull all the words from a line between the two words 'from' and 'by' when I have NO IDEA what's in there, but I know they are all in one line. To make it more difficult. 'by' is optional... Like this: from..by.. or from..

Re: regex question

2007-05-14 Thread Chas Owens
On 5/14/07, Jeff Pang <[EMAIL PROTECTED]> wrote: snip Maybe a space following the "by" is needed? :) snip This what the word boundary character class is for perl -le' for ( "abc from to the word by and the end", "abc from to the end", "abc from this byebye to this") { print $1 if /from(.*?(?

Re: regex question

2007-05-14 Thread Igor Sutton Lopes
Hi, On May 14, 2007, at 11:50 PM, Tom Allison wrote: yitzle wrote: # Requires "by": $line = "daffromHello Worldby"; $line =~ /from(.*)(by)/; print $1; Not sure about making it optional. Can always check if you got "" and then try without the "by" the .* pulls in too much. I'm going to have

Re: regex question

2007-05-14 Thread Jeff Pang
John W. Krahn 写道: $ perl -le' for ( "abc from to the word by and the end", "abc from to the end" ) { print $1 if /from(.*?(?=by)|.*)/; } ' But this coundn't handle this case: $string = "abc from to the word byebye..."; Maybe a space following the "by" is needed? :) -- To unsubscrib

Re: regex question

2007-05-14 Thread John W. Krahn
Tom Allison wrote: > How do I pull all the words from a line between the two words 'from' and > 'by' when I have NO IDEA what's in there, but I know they are all in one > line. > > To make it more difficult. 'by' is optional... > > Like this: > > from..by.. > or > from.. > > I want

Re: regex question

2007-05-14 Thread Tom Allison
yitzle wrote: # Requires "by": $line = "daffromHello Worldby"; $line =~ /from(.*)(by)/; print $1; Not sure about making it optional. Can always check if you got "" and then try without the "by" the .* pulls in too much. I'm going to have to back up and try this again. But I think it's late.

Re: regex question

2007-05-14 Thread yitzle
# Requires "by": $line = "daffromHello Worldby"; $line =~ /from(.*)(by)/; print $1; Not sure about making it optional. Can always check if you got "" and then try without the "by" On 5/14/07, Tom Allison <[EMAIL PROTECTED]> wrote: How do I pull all the words from a line between the two words 'f

Re: Regex question

2007-01-05 Thread M. Lewis
Jay Savage wrote: On 1/4/07, Igor Sutton <[EMAIL PROTECTED]> wrote: > I tried this Igor and it doesn't do exactly what I'm looking for. I > checked the docs and don't think it will do exactly what I want. I need > to do some more reading though. What I want to extract is the domain > name, ala:

Re: Regex question

2007-01-04 Thread Jay Savage
On 1/4/07, Igor Sutton <[EMAIL PROTECTED]> wrote: > I tried this Igor and it doesn't do exactly what I'm looking for. I > checked the docs and don't think it will do exactly what I want. I need > to do some more reading though. What I want to extract is the domain > name, ala: > > asldkjlkwerj.co

Re: Regex question

2007-01-04 Thread Igor Sutton
I tried this Igor and it doesn't do exactly what I'm looking for. I checked the docs and don't think it will do exactly what I want. I need to do some more reading though. What I want to extract is the domain name, ala: asldkjlkwerj.com alaskjhhawe.com qwlkjekwl.com It's right, because URI giv

Re: Regex question

2007-01-04 Thread M. Lewis
Igor Sutton wrote: 2007/1/4, M. Lewis <[EMAIL PROTECTED]>: I'm trying to parse the domain name out of some URLs. In the example data, my regex works fine on the first two URLs, but clips off the first two characters of the domain on the third example. My regex probably could be much better. #

Re: Regex question

2007-01-04 Thread M. Lewis
Igor Sutton wrote: 2007/1/4, M. Lewis <[EMAIL PROTECTED]>: I'm trying to parse the domain name out of some URLs. In the example data, my regex works fine on the first two URLs, but clips off the first two characters of the domain on the third example. My regex probably could be much better. #

Re: Regex question

2007-01-04 Thread Igor Sutton
2007/1/4, M. Lewis <[EMAIL PROTECTED]>: I'm trying to parse the domain name out of some URLs. In the example data, my regex works fine on the first two URLs, but clips off the first two characters of the domain on the third example. My regex probably could be much better. #!/usr/bin/perl use

Re: regex question

2005-11-08 Thread Jeff Pang
In out example then, ([abc]) matches "a" and stores the value "a" in $1. Then all occurances of \1 are replaced with "a". /([abc])[abc]/ says "find me an a, b, or c, save it to $1,a dn find me another a, b, or c" /([abc])\1/ says "find me an a, b, or c, save it to $1, and then find me anoth

Re: regex question

2005-11-08 Thread Jay Savage
Plese respond to the list and: "Because it's up-side down". "Why is that?" "It makes replies harder to read." "Why not?" "Please don't top-post." - Sherm Pendley, Mac OS X Perl list On 11/8/05, Jeff Pang <[EMAIL PROTECTED]> wrote: > ~/perl> perl -e'$abc="[abc]"; print "matched!\n" if "

Re: regex question

2005-11-08 Thread Jay Savage
On 11/8/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Tom Allison wrote: > > if ($text =~ /(.*?($crlf))\2(.*)/sm) { > > > > Do I read this right? > > > > the '\2' is a repeat character of the second match > > where match \1 is (.*?$crlf) and > > match \2 is $crlf ? > > Yes, but you don't reall

Re: regex question

2005-11-08 Thread John W. Krahn
Tom Allison wrote: > if ($text =~ /(.*?($crlf))\2(.*)/sm) { > > Do I read this right? > > the '\2' is a repeat character of the second match > where match \1 is (.*?$crlf) and > match \2 is $crlf ? Yes, but you don't really need the capturing parentheses there: if ( $text =~ /(.*?$crlf)

Re: Regex question (once again)

2004-12-04 Thread John W. Krahn
Jan Eden wrote: Hi, Hello, sorry! Overlooked the g switch, so the first parentheses captures either nothing or the initial \\begin{letter}. Correct. Another way to write it (so you only have one alternation) would be: / (?: \\begin{letter}{ | \\+\s* ) ( [^\\}]+ ) /xg I got it now. Thanks again,

Re: Regex question (once again)

2004-12-03 Thread Jan Eden
Hi, sorry! Overlooked the g switch, so the first parentheses captures either nothing or the initial \\begin{letter}. I got it now. Thanks again, Jan -- These are my principles and if you don't like them... well, I have others. - Groucho Marx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Regex question (once again)

2004-12-03 Thread Jan Eden
Hello John, John W. Krahn wrote on 03.12.2004: >Jan Eden wrote: >> Hi, > >Hello, > >> I have lines like the following: >> >> \begin{letter}{Name\\ Street\\ ZIP\\ Country} >> \begin{letter}{Name\\ Street\\ ZIP} >> >> To extract the info, I used >> >> my ($data) = $file_content =~ /\\begin{lette

Re: Regex question (once again)

2004-12-03 Thread John W. Krahn
Jan Eden wrote: Hi, Hello, I have lines like the following: \begin{letter}{Name\\ Street\\ ZIP\\ Country} \begin{letter}{Name\\ Street\\ ZIP} To extract the info, I used my ($data) = $file_content =~ /\\begin{letter}{(.+?)}/; my ($name, $street, $zip, $country) = split / /, $data; But I wonder

Re: RegEx Question

2004-07-21 Thread Jenda Krynicky
From: Mike Dillinger <[EMAIL PROTECTED]> > --- Original Message > From: Zysman, Roiy <[EMAIL PROTECTED]> > > ZR> Is there a way to extract a filename out of a path string using > just one ZR> RegEx and not using the split function ? > > ZR> For Example, I want to extract foo.txt from /my/long/pat

Re: RegEx Question

2004-07-18 Thread Mike Dillinger
Hi Roy, --- Original Message From: Zysman, Roiy <[EMAIL PROTECTED]> Date: Sunday, July 18, 2004 at 01:14AM PDT ZR> Is there a way to extract a filename out of a path string using just one ZR> RegEx and not using the split function ? ZR> For Example, I want to extract foo.txt from /my/long/path/f

Re: RegEx Question

2004-07-18 Thread Randy W. Sims
On 7/18/2004 4:14 AM, Zysman, Roiy wrote: Hi all, Is there a way to extract a filename out of a path string using just one RegEx and not using the split function ? For Example, I want to extract foo.txt from /my/long/path/foo.txt path string. use File::Basename; -or- use File::Spec; Both are core

Re: regex question "match everything that does not include the string ''

2004-01-26 Thread Mark Maunder
Thanks Jeff, that helps. I use HTML::Parser for various tasks, but for this particular one, I need exact matching, hence the regex. On Mon, 2004-01-26 at 09:57, Jeff 'japhy' Pinyan wrote: > On Jan 26, Mark Maunder said: > > >I'm matching html using regex and use something like this to grab a > >c

Re: regex question "match everything that does not include the string ''

2004-01-26 Thread Jeff 'japhy' Pinyan
On Jan 26, Mark Maunder said: >I'm matching html using regex and use something like this to grab a >chunk of text up to the next html tag: > >([^<]+) > >But I'd like to say "match everything that does not include the string >" rather than "match everything that does not include a "<" >character. A

Re: regex question

2003-09-12 Thread James Edward Gray II
On Friday, September 12, 2003, at 10:41 AM, Johnson, Shaunn wrote: Howdy: Is it possible to use regex to replace the first n characters of a line? There are no unique markers or items to map by in these files ... some lines could start with number or whatever (special characters, white space, al

Re: regex question

2003-08-14 Thread David Wall
--On Sunday, August 10, 2003 7:19 AM -0600 Trevor Morrison <[EMAIL PROTECTED]> wrote: When I run my program with "use warnings". I get the following error: Use of uninitialized value in concatenation (.) or string at miva_order_check.pl line 52, line 40067. Here is the is offending line of co

Re: Regex question

2003-07-01 Thread Janek Schleicher
Jeff 'Japhy' Pinyan wrote at Tue, 01 Jul 2003 12:39:37 -0400: > On Jul 1, [EMAIL PROTECTED] said: > >>\.[^(gz|html)]$ >> >>this regex should match all files (lines) NOT ending with gz or html. > > or else use a negative look-ahead: > > if ($filename =~ /\.(?!gz|html)[^.]*$/) { > # (?!...)

Re: Regex question

2003-07-01 Thread Jeff 'japhy' Pinyan
On Jul 1, [EMAIL PROTECTED] said: >\.[^(gz|html)]$ > >this regex should match all files (lines) NOT ending with gz or html. No, it shouldn't. It should match all files ending with a . followed by a character that is not any of ()|^ghlmtz, followed by the end of the string. >but this is not work

RE: Regex question

2003-07-01 Thread Sparrow, Dave
How about print if !m/\.(gz)|(html)$/; Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 01 July 2003 13:20 To: [EMAIL PROTECTED] Subject: Regex question hi, i have this regex: \.[^(gz|html)]$ this regex should match all files (lines) NOT ending with gz

Re: Regex question

2003-07-01 Thread mgoland
Hello mage - Original Message - From: [EMAIL PROTECTED] Date: Tuesday, July 1, 2003 8:20 am Subject: Regex question > hi, i have this regex: > > \.[^(gz|html)]$ > > this regex should match all files (lines) NOT ending with gz or html. > but this is not working. the lines ending with .gz

Re: Regex question

2003-02-25 Thread lobach
Here is the perl script being used.. It supposedly takes regex or perl expressions for parameters.. however I have to search for the following string : TDS-RES.1.2345678 but when I use the following regex it fails: peg "TDS-RES/.1/.2345678" MEDLAB* peg: error in Perl expression: (TDS-RES\.1\.2

Re: Regex question

2003-02-24 Thread John W. Krahn
Steve Lobach wrote: > > I have a perl script that acts like grep, however, it doesn't totally do what is > expected.. > The script is called peg.. > > It supposedly takes regex or perl expressions for parameters.. however I have to > search for the following string : > > TDS-RES.1.2345678 If

RE: Regex question

2002-12-13 Thread Paul Kraus
Crap I read that wrong. I was thinking like you noticed of not having to escape the "forward" slash. My bad :) > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 13, 2002 8:56 AM > To: [EMAIL PROTECTED] > Su

Re: Regex question

2002-12-13 Thread John W. Krahn
Paul Kraus wrote: > > > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > > > > Yes that will work although you don't need to backslash the > > quote in the regular expression. > > > > $ perl -le'$_ = q[one "two" three]; s{"}{\\"}g; print' > > one \"two\" three > > Correct me if I am wrong but the

RE: Regex question

2002-12-13 Thread wiggins
s that the \ is escaping the following character. Not sure this is making much sense... I swear it sounds right in my head ;-)... http://danconia.org > > -Original Message- > > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > > Sent: Friday, December 13, 2002 8:25 AM &

RE: Regex question

2002-12-13 Thread Paul Kraus
y, December 13, 2002 8:25 AM > To: [EMAIL PROTECTED] > Subject: Re: Regex question > > > Colin Johnstone wrote: > > > > Gidday all, > > Hello, > > > I have a paragraph of text, I want to convert any double > quotes around > > quoted text to

Re: Regex question

2002-12-13 Thread John W. Krahn
Colin Johnstone wrote: > > Gidday all, Hello, > I have a paragraph of text, I want to convert any double quotes around > quoted text to \" is this the correct reg ex > > $paragraph =~ s{\"}{\\"}g; Yes that will work although you don't need to backslash the quote in the regular expression. $ p

RE: Regex question

2002-12-12 Thread Johnstone, Colin
Thanks Mate, worked like a treat. Colin -Original Message- From: Aman Thind [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 16:39 To: Johnstone, Colin Subject: RE: Regex question Just add another backslash to the "Substitute With" part of the expression as in :

RE: RegEx question

2002-08-13 Thread Kipp, James
rindex() should work or substr() using a negative number as the offset > -Original Message- > From: Yacketta, Ronald [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 12, 2002 4:32 PM > To: begin begin > Subject: RegEx question > > > All, > > Have a quick regex question here ;) >

Re: RegEx question

2002-08-12 Thread John W. Krahn
Ronald Yacketta wrote: > > Have a quick regex question here ;) > > What is the sequence to search for a string backwards? > IE: > > 03:17amup 36 days, 49 mins, load average: 1.90, 1.83, 1.75 > > Instead of splitting/searching what have you to get the middle > number (1.83) > I think it wo

RE: RegEx question

2002-08-12 Thread David . Wagner
You might try a indexr looking for the 1st and 2nd comma from the right. What is between those columns would be your number. As to being easier, unsure of that. Though you could possible do something like: /,\s*(\d+\.\d+),\s*\d+\.\d+$/ which would have

Re: regex question

2002-07-26 Thread John W. Krahn
Steve wrote: > > From what I have read from The Camel $1 should contain the matched text. > From that matched text I want to then search for an additional string. $1 contains the text matched in the first set of parentheses. > I have this in a file: > > Connect time 8.3 minutes > Connect time

RE: regex question

2002-07-26 Thread Mark Anderson
-Original Message- From: Steve [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 5:21 PM To: Mark Anderson Cc: Beginners@Perl. Org Subject: Re: regex question >From what I have read from The Camel $1 should contain the matched text. >From that matched text I want to then

Re: regex question

2002-07-26 Thread Steve
>From what I have read from The Camel $1 should contain the matched text. >From that matched text I want to then search for an additional string. I have this in a file: Connect time 8.3 minutes Connect time 100.1 minutes (etc) $line gets the whole line and from there I wanna place the numerica

RE: regex question

2002-07-26 Thread Mark Anderson
$1 is a special variable. What are you actually trying to do here? What do you want to have print? [I've copied you, but please respond to the list.] /\/\ark -Original Message- From: Steve [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 4:20 PM T

Re: Regex question again

2002-06-27 Thread Felix Geerinckx
on Thu, 27 Jun 2002 15:15:04 GMT, [EMAIL PROTECTED] (David Vd Geer Inhuur Tbv Iplib) wrote: > Can you please assist. I am stuck on a regex again. > > my $dir = "/user/IPlib/and/many/other/dirs"; > > $dir =~ s!/[^/]*\z!!; > > Will make : $dir = "/user/IPlib/and/many/other"; ## so it takes > o

RE: Regex question again

2002-06-27 Thread Hanson, Robert
> But how do I let it make : > $dir = "/IPlib/and/many/other/dirs"; ## But now on the first dir $dir =~ s!^[^/]*!!; ^ = Beginning of the string. Rob -Original Message- From: David vd Geer Inhuur tbv IPlib [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 11:15 AM To: [EMAIL PRO

RE: RegEx question

2002-04-24 Thread Ron Goral
to:[EMAIL PROTECTED]> > -Original Message- > From: Shaun Fryer [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 5:49 PM > To: Perl Beginners > Subject: Re: RegEx question > > > > > I have been using the below subroutine for Parsing my data from forms. &

Re: RegEx question

2002-04-23 Thread Shaun Fryer
> > I have been using the below subroutine for Parsing my data from forms. Up until recently I was using cgi-lib.pl's ReadParse routine to do the same thing. Since the one you are using is quite similar you can easily port existing scripts using the following in place of that subroutine. use CGI

RE: RegEx question

2002-04-23 Thread Timothy Johnson
that always implies adjustment for context. -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 11:46 AM To: Ron Cc: [EMAIL PROTECTED] Subject: Re: RegEx question On Apr 23, Ron said: >Thank you. I feel like a dummy. Duh, t

Re: RegEx question

2002-04-23 Thread Jeff 'japhy' Pinyan
On Apr 23, Ron said: >Thank you. I feel like a dummy. Duh, tr = translate, I learned that in my >beginning PERL classes. Thank you folks for jogging my feeble mind. Actually, tr/// stands for "transliterate", which means something different. Translation is a context-related conversion of on

Re: RegEx question

2002-04-23 Thread Ron
Thank you. I feel like a dummy. Duh, tr = translate, I learned that in my beginning PERL classes. Thank you folks for jogging my feeble mind. Ron -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: RegEx question

2002-04-23 Thread Michael M. L. Broggy
On Tue, 23 Apr 2002, Ron wrote: > I have been using the below subroutine for Parsing my data from forms. The > question I have; can someone explain this line to me, > $value =~ tr/+/ /; > > The tr has me a bit confused. tr is "transliterate", so it translates the first argument (+, in this cas

RE: RegEx question

2002-04-23 Thread Hanson, Robert
tr/// "translates" from one character to another. So fo each "+" it finds it "translates" it to a space. The purpose of tr/// is to be able to give it one or more characters in the left part of the match and one or more characters on the right side, and it will translate each char on the left to

Re: RegEx question

2002-04-23 Thread Jenda Krynicky
From: "Ron" <[EMAIL PROTECTED]> > I have been using the below subroutine for Parsing my data from forms. Please don't! use CGI; or use CGI::Lite; even use CGI::Deurl; but don't try it yourself. > The question I have; can someone explain this line to me, $value

RE: RegEx question

2002-04-23 Thread Stout, Joel R
Just translates your "+" to " ". my ($key); $key = "one two three+four"; $key =~ tr/+/ /; print "$key\n"; one two three four -Original Message- From: Ron [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 11:18 AM To: [EMAIL PROTECTED] Subject: RegEx question I have been usi

Re: regex question

2002-04-18 Thread Martin A. Hansen
hi john i implementet your solution. mine actually did work, but yours seemed more logical. it works nicely. thank you martin On Wed, Apr 17, 2002 at 12:58:07PM -0700, John W. Krahn wrote: > [EMAIL PROTECTED] wrote: > > > > hi, > > Hello, > > > im pasting some more of the lines i need to p

Re: regex question

2002-04-17 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > hi, Hello, > im pasting some more of the lines i need to parse. i guess > im just learning regex and just espesially learning how to > ask the correct questions! heh, dont ask regex without > showing enuf of the stuff you want to parse :) > > theres is these three

Re: regex question

2002-03-13 Thread Boris Zentner
Hi Martin, > > > i have a long text file. in this text file several strings of the form: > ### filename.jpg ### are embedded. > > how should a regex look that takes following: > > ### filename.jpg ### > > and returns > try this. s/### (\w+\.jpg) ###//; the filename is in $1 > > > and th

Re: regex question

2002-03-13 Thread victor
Try this regexp. s/###.*?###//g; [EMAIL PROTECTED] wrote: > hi > > i have a long text file. in this text file several strings of the form: ### >filename.jpg ### are embedded. > > how should a regex look that takes following: > > ### filename.jpg ### > > and returns > > > > and the filen

Re: regex question

2002-02-14 Thread Jon Molin
sorry about that answer, too early in the morning to answer questions...i even thought it was the newest. I wish I could go back to sleep /jon -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regex question

2002-02-14 Thread Jon Molin
rory oconnor wrote: > > I am using LWP to hit a page and save the source to a file. But before > it saves it I want it to strip out the client id from the urls. They > are always in the same format: > > client=& # 8 digits and then ampersand > > so what I want to strip out is stuff l

Re: regex question

2002-02-13 Thread Johnathan Kupferer
> > >client=& # 8 digits and then ampersand > >so what I want to strip out is stuff like: > >client=23894749& > You want something like: $url =~ s/client=\d\d\d\d\d\d\d\d&//; or if you don't want to count those \d's $url =~ s/client=\d{8}&//; And since cilent=& probably can pr

RE: regex question

2002-02-13 Thread James Kelty
This might work for you. I don't really have all the info from you that I would need, but assuming that there is a file "url.txt" that is formated like this: http://www.feathertrip.net/cgi-bin/index.cgi?client=23894749&; http://www.feathertrip.net/cgi-bin/index.cgi?client=23894749&; http://www.fe

Re: Regex question about '\b'

2002-02-05 Thread Chas Owens
On Tue, 2002-02-05 at 15:34, Jeff 'japhy' Pinyan wrote: > On Feb 5, Shawn said: > > > In a regex, the '\b' can stand for: > >1) a boundry between a word and non-word char > >2) bakcspace > > > > What is the precedence for figuring out which is being called? > > \b is ONLY "backspace" w

Re: Regex question about '\b'

2002-02-05 Thread Brett W. McCoy
On Tue, 5 Feb 2002, Shawn wrote: > In a regex, the '\b' can stand for: > 1) a boundry between a word and non-word char > 2) bakcspace \b can be used inside of [] (as part of a character class) to mean a backspace, but outside, \b always means 'word boundary assertion'. If you don't wa

  1   2   >