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
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
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.
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.
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
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
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
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
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
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
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 (<>)
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
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
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/^\.
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
> "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
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
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
>
> "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
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
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
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
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
> "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
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
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][
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
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
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] <
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
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
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
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..
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(.*?(?
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
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
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
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.
# 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
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:
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
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
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.
#
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.
#
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
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
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 "
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
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)
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,
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
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
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
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
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
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
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
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
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
--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
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)[^.]*$/) {
> # (?!...)
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
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
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
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
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
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
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
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
&
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
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
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 :
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 ;)
>
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
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
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
-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
>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
$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
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
> 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
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.
&
> > 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
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
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
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]
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
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
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
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
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
[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
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
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
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]
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
>
>
>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
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
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
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 - 100 of 115 matches
Mail list logo