Re: escaping regex to do math on backreferences

2009-04-13 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson nore...@gunnar.cc wrote: Chas. Owens wrote: my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /; my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /; --^ snip That depends on who you play with. Ok. Also, if you

Re: escaping regex to do math on backreferences

2009-04-13 Thread Chas. Owens
On Mon, Apr 13, 2009 at 06:12, Gunnar Hjalmarsson nore...@gunnar.cc wrote: snip Also, if you make that change you need to check the for loop as well: for my $i (0 .. 10) { Actually no. $ perl -wle ' @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A/; print map $_.[cdhs], @rank[10..10+4]; ' Use of

Re: escaping regex to do math on backreferences

2009-04-12 Thread Gunnar Hjalmarsson
Andrew Fithian wrote: I have a program that needs to find straights in a hand of cards. Only straights? The hand is a string with no whitespace sorted by the cards' ranks, eg 9d10cJhQsKd. How can I identify if that hand contains a straight with a single regex? Why on earth would you want

Re: escaping regex to do math on backreferences

2009-04-12 Thread Chas. Owens
On Sun, Apr 12, 2009 at 18:34, Andrew Fithian afit...@gmail.com wrote: Hello everyone, I have a program that needs to find straights in a hand of cards. The hand is a string with no whitespace sorted by the cards' ranks, eg 9d10cJhQsKd. How can I identify if that hand contains a straight with

Re: escaping regex to do math on backreferences

2009-04-12 Thread Gunnar Hjalmarsson
Chas. Owens wrote: my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /; my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /; --^ -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: escaping regex to do math on backreferences

2009-04-12 Thread Chas. Owens
On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson nore...@gunnar.cc wrote: Chas. Owens wrote: my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /;    my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /; --^ snip That depends on who you play with. Also, if you make that change you need to

RE: Escaping a plus sign

2006-05-31 Thread Ken Lehman
Is it the if ($MGMTCMNT =~ /$MGMTNM/) part that is tripping you up? I believe you could change it to if ($MGMTCMNT =~ /\Q$MGMTNM\E/) if you need to keep the regular expression. Another idea might be to change it to if ( ($start = index($MGMTCMNT, $MGMTNM ()) 0) { -Original Message-

Re: Escaping a plus sign

2006-05-31 Thread Dr.Ruud
Paul Nowosielski schreef: The script will die if the is a + sign in the fields its parsing. perldoc -f quotemeta -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Escaping a plus sign

2006-05-30 Thread Anthony Ettinger
should probably escape the + sign with \+ $field =~ s/\+/\\+/g; On 5/30/06, Paul Nowosielski [EMAIL PROTECTED] wrote: Dear All, I have a perl script that runs nightly. It create a data feed. The script will die if the is a + sign in the fields its parsing. Here is the snippet: while

Re: Escaping a plus sign

2006-05-30 Thread Paul Nowosielski
So would this be the correct solution: while (($PKEY, $MGMTCMNT, $manager_id, $MGMTNM, $UPDATE1, $UPDATE2) = $sth-fetchrow_array) { $comment = ; # added to escape the plus sign $MGMTCMNT = ~ s/\+/\\+/g; $MGMTNM = ~ s/\+/\\+/g; if ($MGMTCMNT =~

Re: Escaping a plus sign

2006-05-30 Thread John W. Krahn
Paul Nowosielski wrote: Dear All, Hello, I have a perl script that runs nightly. It create a data feed. The script will die if the is a + sign in the fields its parsing. Here is the snippet: while (($PKEY, $MGMTCMNT, $manager_id, $MGMTNM, $UPDATE1, $UPDATE2) = $sth-fetchrow_array)

Re: Escaping large chunk of text for insertion into mysql

2006-02-01 Thread John Doe
Kevin Old am Mittwoch, 1. Februar 2006 13.44: Hello everyone, I have a large chunk of data that I need to insert into a text or blob field in mysql. I've tried all the usually escaping it, but nothing seems to work. I'm even using dbh-quote as I thought it might help. Here's my code: my

Re: Escaping with tr

2005-09-02 Thread Bernard van de Koppel
Hi, Thanks for the warning. As far as the specs are, a semicolon is not allowed as data in the datastream (yet) (of an electronic banking backend application). Some files however don't use the doublequote combined with the semicolon, but just the semicolon to identify fields. So far the

Re: Escaping with tr

2005-08-30 Thread Eric Walker
On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote: bla bla;bla bla;bla bla cat test.file | sed 's/\//g' editedfile -- Eric Walker EDA/CAD Engineer Work: 208-368-2573 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Escaping with tr

2005-08-30 Thread JupiterHost.Net
Eric Walker wrote: On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote: bla bla;bla bla;bla bla cat test.file | sed 's/\//g' editedfile Good solution for sed list and if you like redirtecting from a pipe and using multiple program when unnecessary (do you also where mits

Re: Escaping with tr

2005-08-30 Thread Wiggins d'Anconia
Eric Walker wrote: On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote: bla bla;bla bla;bla bla cat test.file | sed 's/\//g' editedfile Quick someone get the can of UUoC Be Gone ... ;-) http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Escaping with tr

2005-08-30 Thread Bernard van de Koppel
Eric, thanks for the response. After some fideling, I found a solution. $text=~ tr/\042/ /; Thanks. On Tuesday 30 August 2005 22:20, Eric Walker wrote: On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote: bla bla;bla bla;bla bla cat test.file | sed 's/\//g' editedfile --

Re: Escaping with tr

2005-08-30 Thread Scott Taylor
Bernard van de Koppel said: Hi, How can I get all the characters out of a csv file. Input looks like bla bla;bla bla;bla bla and it has to look like bla bla;bla bla; bla bla I tried $text=~ tr(#\##); but perl keeps complaining about Might be a runaway multi-line ;; starting on the

Re: Escaping with tr

2005-08-30 Thread Wiggins d'Anconia
Scott Taylor wrote: Hi, How can I get all the characters out of a csv file. Input looks like bla bla;bla bla;bla bla and it has to look like bla bla;bla bla; bla bla I tried $text=~ tr(#\##); but perl keeps complaining about Might be a runaway multi-line ;; On a more serious note. Simply

Re: Escaping with tr

2005-08-30 Thread Scott Taylor
Wiggins d'Anconia said: Scott Taylor wrote: I did not. Hi, How can I get all the characters out of a csv file. Input looks like bla bla;bla bla;bla bla and it has to look like bla bla;bla bla; bla bla I tried $text=~ tr(#\##); but perl keeps complaining about Might be a runaway multi-line

Re: Escaping with tr

2005-08-30 Thread Bernard van de Koppel
Hi, Thanks, this works great. Bernard On Tuesday 30 August 2005 23:23, Scott Taylor wrote: Hi, How can I get all the characters out of a csv file. Input looks like bla bla;bla bla;bla bla and it has to look like bla bla;bla bla; bla bla I tried $text=~ tr(#\##); but perl

Re: Escaping with tr

2005-08-30 Thread John W. Krahn
Bernard van de Koppel wrote: Hi, Hello, How can I get all the characters out of a csv file. Input looks like bla bla;bla bla;bla bla and it has to look like bla bla;bla bla; bla bla I tried $text=~ tr(#\##); $text =~ tr///d; John -- use Perl; program fulfillment -- To

Re: escaping values (DBD::mysql)

2005-08-01 Thread Jeff 'japhy' Pinyan
On Jul 31, Octavian Rasnita said: select ... limit 0,30; but I cannot use: $sth = $dbh-prepare(select ... limit ?,?); $sth-execute(0, 30); ... because DBI replaces the values entered with '0' and '30' and the query won't be valid. No, you probably can't do that because your SQL engine

Re: escaping @

2005-07-19 Thread Charles Farinella
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote: I had to add a 'chomp' and make sure the line endings in my file were correct, but this worked and I learned something useful as well. Thank you. :-) --charlie Only do things in the loop that must be done in the loop. Reconnecting,

RE: escaping @

2005-07-18 Thread Moon, John
Subject: escaping @ I'm sure this is very simple and I am overlooking something. I want to read a list of bad email addresses from a file and remove them from my database. If I print $_, the email addresses are correct, if I try to remove them from the db I get errors on just the characters

Re: escaping @

2005-07-18 Thread Wiggins d'Anconia
Charles Farinella wrote: I'm sure this is very simple and I am overlooking something. I want to read a list of bad email addresses from a file and remove them from my database. If I print $_, the email addresses are correct, if I try to remove them from the db I get errors on just the

Re: escaping @

2005-07-18 Thread Charles Farinella
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote: Charles Farinella wrote: I'm sure this is very simple and I am overlooking something. I want to read a list of bad email addresses from a file and remove them from my database. If I print $_, the email addresses are correct, if I

Re: escaping @

2005-07-18 Thread Wiggins d'Anconia
Charles Farinella wrote: On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote: Charles Farinella wrote: I'm sure this is very simple and I am overlooking something. I want to read a list of bad email addresses from a file and remove them from my database. If I print $_, the email addresses

Re: escaping @

2005-07-18 Thread Wiggins d'Anconia
Lawrence Statton wrote: On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote: Charles Farinella wrote: I'm sure this is very simple and I am overlooking something. I want to read a list of bad email addresses from a file and remove them from my database. If I print $_, the email addresses

Re: escaping in CGI.pm

2005-06-24 Thread Joshua Colson
Scott, You're trying to use an ampersand in your URL. Ampersands are special characters in URLs so you must escape it if you want it to be passed as the actual character instead of carrying the special meaning. See http://www.december.com/html/spec/esccodes.html On Fri, 2005-06-24 at 12:51

Re: escaping in CGI.pm

2005-06-24 Thread Scott Taylor
Joshua Colson said: Scott, You're trying to use an ampersand in your URL. Ampersands are special characters in URLs so you must escape it if you want it to be passed as the actual character instead of carrying the special meaning. See http://www.december.com/html/spec/esccodes.html As I

Re: escaping in CGI.pm

2005-06-24 Thread Wiggins d'Anconia
Scott Taylor wrote: Joshua Colson said: Scott, You're trying to use an ampersand in your URL. Ampersands are special characters in URLs so you must escape it if you want it to be passed as the actual character instead of carrying the special meaning. See

RE: Escaping quotes in variable content

2004-05-12 Thread jon
print form name=\test\ action=\http://www.somewhere.com\;\n; printinput type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\ /\n; print /form\n; This wasn't really the question, but... If you have to write html within perl, use qq( ) instead of . It's a lot easier to read, and

RE: Escaping quotes in variable content

2004-05-12 Thread Edvaldo Barbosa Guimar�es
, 2004 11:44 AM To: 'Jan Eden'; Perl Lists Subject: RE: Escaping quotes in variable content Try this: input type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\ -Original Message- From: Jan Eden [mailto:[EMAIL PROTECTED] Sent: 11 May 2004 03:59 PM To: Perl Lists Subject

Re: Escaping quotes in variable content

2004-05-11 Thread David Dorward
On 11 May 2004, at 14:58, Jan Eden wrote: how can I escape quotes within a variable's content? I use the following directive to fill an HTML form: input type=text name=frage_text size=100 value=$frage_text / Unfortunately, if $frage_text contains a double quote, the browser will stop displaying

Re: Escaping quotes in variable content

2004-05-11 Thread Jan Eden
Hi David, David Dorward wrote on 11.05.2004: On 11 May 2004, at 14:58, Jan Eden wrote: how can I escape quotes within a variable's content? I use the following directive to fill an HTML form: input type=text name=frage_text size=100 value=$frage_text / Unfortunately, if $frage_text contains a

RE: Escaping quotes in variable content

2004-05-11 Thread Ash Singh
Try this: input type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\ -Original Message- From: Jan Eden [mailto:[EMAIL PROTECTED] Sent: 11 May 2004 03:59 PM To: Perl Lists Subject: Escaping quotes in variable content Hi all, how can I escape quotes within a variable's

RE: Escaping quotes in variable content

2004-05-11 Thread Ash Singh
; printinput type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\ /\n; print /form\n; I hope this helps Regards Ash. -Original Message- From: Jan Eden [mailto:[EMAIL PROTECTED] Sent: 11 May 2004 04:21 PM To: David Dorward; Perl Lists Subject: Re: Escaping quotes in variable

RE: Escaping quotes in variable content

2004-05-11 Thread Wiggins d Anconia
the archive, please don't do this. escapeHTML or HTML::Entities should do very well. http://danconia.org -Original Message- From: Jan Eden [mailto:[EMAIL PROTECTED] Sent: 11 May 2004 04:21 PM To: David Dorward; Perl Lists Subject: Re: Escaping quotes in variable content Hi

RE: Escaping quotes in variable content

2004-05-11 Thread Jan Eden
[EMAIL PROTECTED] wrote on 11.05.2004: print form name=\test\ action=\http://www.somewhere.com\;\n; printinput type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\ /\n; print /form\n; This wasn't really the question, but... If you have to write html within perl, use qq( )

Re: Escaping

2004-04-08 Thread James Edward Gray II
On Apr 8, 2004, at 4:30 PM, [EMAIL PROTECTED] wrote: Is there any quick way of parsing a string like: This,Is,A,String,\,,With,A,Comma Into a list (This, Is, A, String, ,, With, A, Comma) Basically, how can I split it by commas, except when it is escaped. How about: my @fields = split

Re: Escaping

2003-08-08 Thread Kristofer Hoch
Marcus, You are going to have to URL escape it. Review URI::Escape... http://theoryx5.uwinnipeg.ca/CPAN/data/URI/URI/Escape.html Thanks, Kristofer = -BEGIN GEEK CODE BLOCK- Version: 3.12 GIT d s+:++ a C++ UL++ US+ P+++ L++ W+++ w PS PE t++ b+ G e r+++ z --END GEEK CODE

Re: Escaping Ampersands in XML

2003-01-16 Thread Jenda Krynicky
From: Ben Siders [EMAIL PROTECTED] I've got a real easy one here (in theory). I have some XML files that were generated by a program, but generated imperfectly. There's some naked ampersands that need to be converted to amp;. I need a regexp that will detect them and change them. Sounds

Re: Escaping Ampersands in XML

2003-01-16 Thread Jenda Krynicky
Toby Stuart wrote: Try this one: s/(?!\w+;)/amp;/g Problem is that this will break things like #64; Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. --

Re: Escaping Ampersands in XML

2003-01-16 Thread Rob Dixon
Jenda Krynicky wrote: Toby Stuart wrote: Try this one: s/(?!\w+;)/amp;/g Problem is that this will break things like #64; Why not just: s/(?!amp;)/amp;/g i.e. change every ampersand that isn't followed by 'amp;' into amp; Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Escaping Ampersands in XML

2003-01-15 Thread Toby Stuart
-Original Message- From: Ben Siders [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 7:38 AM To: Perl Subject: Escaping Ampersands in XML I've got a real easy one here (in theory). I have some XML files that were generated by a program, but generated

Re: Escaping characters

2002-06-04 Thread Felix Geerinckx
on Tue, 04 Jun 2002 17:14:54 GMT, Barry Jones wrote: Hi, I'm trying to do a patter match for everything contained within {{ stuff }}. Now I've gotten this to work just fine with ** stuff **, ^^ and a several others, but I can't get curly braces to work and I have no idea why. I've

RE: Escaping characters

2002-06-04 Thread Bob Showalter
-Original Message- From: Barry Jones [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 1:15 PM To: Beginners @ Perl (E-mail) Subject: Escaping characters Hi, I'm trying to do a patter match for everything contained within {{ stuff }}. Now I've gotten this to

RE: Escaping characters

2002-06-04 Thread Barry Jones
Jones; Beginners @ Perl (E-mail) Subject: RE: Escaping characters -Original Message- From: Barry Jones [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 1:15 PM To: Beginners @ Perl (E-mail) Subject: Escaping characters Hi, I'm trying to do a patter match

Re: Escaping HTML tags

2002-03-23 Thread root
I'll gotta stop sending over-caffinated emails...wow, -w works... Scott Wahlstrom wrote: Severe newbie that would RTFM if I would have brought it home and i'm not asking the right monestary search strings so i humbly ask for your help... i'll go get going on a fresh pot of

Re: Escaping HTML tags

2002-03-23 Thread bob ackerman
easiest i would think is here-doc. I like: open (OUTP, hdtst) or die no can open\n; print OUTP HEHE; abc def ghi jkl HEHE On Saturday, March 23, 2002, at 08:15 PM, Scott Wahlstrom wrote: Severe newbie that would RTFM if I would have brought it home and i'm not asking the right monestary

Re: Escaping special characters for regular expressions

2002-02-28 Thread eric-perl
On Wed, 27 Feb 2002, W P wrote: I have a CGI script which takes two strings. It searches for the first string in a file, replacing it with the second one. This file isn't really important, more for fun, so I'm not too worried about people deleting the whole file if they actually type out

Re: Escaping special characters for regular expressions

2002-02-28 Thread W P
i don't want to just escape those characters. they were merely examples. i was hoping maybe there was some built-in way to escape ALL the characters that mean anything to regular expressions. it just seemed like a lot of work to put a \ before all the characters that regular expressions

Re: Escaping special characters for regular expressions

2002-02-28 Thread Curtis Poe
--- W P [EMAIL PROTECTED] wrote: i don't want to just escape those characters. they were merely examples. i was hoping maybe there was some built-in way to escape ALL the characters that mean anything to regular expressions. Well, technically, *all* characters mean something to a regex. I

Re: Escaping special characters for regular expressions

2002-02-28 Thread Rob Roudebush
Wouldn't single quotes do the trick? Curtis Poe [EMAIL PROTECTED] wrote: --- W P wrote: i don't want to just escape those characters. they were merely examples. i was hoping maybe there was some built-in way to escape ALL the characters that mean anything to regular expressions. Well,

RE: escaping v$session

2001-06-25 Thread Stephen Neu
Try 'v$session' instead of v$session The single quote doesn't interpolate variables like the double-quote. From perldoc perlop Customary Interpolates '' no yes `` yes qw{}no // yes :-Original Message- :From:

RE: escaping v$session

2001-06-25 Thread Yacketta, Ronald
-Original Message- From: Stephen Neu [mailto:[EMAIL PROTECTED]] Sent: Monday, June 25, 2001 12:04 PM To: Perl Beginners (E-mail) Subject: RE: escaping v$session Try 'v$session' instead of v$session The single quote doesn't interpolate variables like the double-quote

RE: escaping v$session

2001-06-25 Thread Stephen Neu
:@active = qx( :sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -! :select count(distinct(process)) ACTIVE from --- v$session --- :where last_call_et 60 and :process in (select ltrim(rtrim(to_char(process_id) )) from :session_list); :quit :! :); Ok, so you're using qx(foo), which is the same

RE: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 12:15:15 -0400, Yacketta, Ronald wrote: snip / this is what I am trying todo @active = qx( sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -! select count(distinct(process)) ACTIVE from --- v$session --- where last_call_et 60 and process in (select

RE: escaping v$session

2001-06-25 Thread Stephen Neu
:@active = qx( :sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -! :select count(distinct(process)) ACTIVE from --- v$session --- :where last_call_et 60 and :process in (select ltrim(rtrim(to_char(process_id) )) from :session_list); :quit :! :); Oh... Didn't see the other variables you were

RE: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote: This one was really close :) I had to change select count(distinct(process)) ACTIVE from . 'v$session' . to select count(distinct(process)) ACTIVE from . 'v\$session' . and it worked! Thanxs everyone! Ron What version

Re: escaping v$session

2001-06-25 Thread Chas Owens
On 25 Jun 2001 09:47:08 -0800, Michael Fowler wrote: On Mon, Jun 25, 2001 at 01:09:51PM -0400, Chas Owens wrote: On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote: select count(distinct(process)) ACTIVE from . 'v$session' . select count(distinct(process)) ACTIVE from .

Re: escaping v$session

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 02:09:59PM -0400, Chas Owens wrote: @active = qx( sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -! select count(distinct(process)) ACTIVE from v\\\$session where last_call_et 60 and process in (select ltrim(rtrim(to_char(process_id) )) from session_list); quit !

Re: escaping v$session

2001-06-25 Thread Michael Fowler
On Mon, Jun 25, 2001 at 02:24:21PM -0400, Chas Owens wrote: Let me see if I have this straight: Perl was ignoring $session because of the \ and then passing the output to the shell (stripping the \). Yes. The shell saw $session so it tried to replace it with the enviromental variable