Re: Selecting using regular expressions

2003-08-14 Thread Wiggins d'Anconia
Octavian Rasnita wrote: Hi all, I want to select all the content of a table from a file using regular expressions (and not a module). Can you give me some hints about how can I do this? Uh, use a module. For example I have the following text: .. .. ... ... As you see, I

Selecting using regular expressions

2003-08-14 Thread Octavian Rasnita
Hi all, I want to select all the content of a table from a file using regular expressions (and not a module). Can you give me some hints about how can I do this? For example I have the following text: .. .. ... ... As you see, I could find more other tables included in

RE: Problem with regular expressions!!!

2003-03-19 Thread Hanson, Rob
none). $test =~ /foo.*?bar/; Also... + = 1 or more (greedy) +? = 1 or more, non-greedy. Rob -Original Message- From: Rob Benton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 2:07 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Problem with regular expressions!!! H

Re: Problem with regular expressions!!!

2003-03-19 Thread Rob Benton
How does it translate? * = 0 or more of preceding char ? = 1 or 0 of preceding char *? = ??? On Tue, 2003-03-18 at 21:41, Michael Kelly wrote: > On Tue, Mar 18, 2003 at 05:53:45PM -0600, Rob Benton wrote: > > It looks odd to me b/c * and ? are both quantifiers... > > * and ? alone are both quan

Re: Problem with regular expressions!!!

2003-03-19 Thread Michael Kelly
On Tue, Mar 18, 2003 at 05:53:45PM -0600, Rob Benton wrote: > It looks odd to me b/c * and ? are both quantifiers... * and ? alone are both quantifiers, but *? is a non-greedy *. -- Michael [EMAIL PROTECTED] http://www.jedimike.net/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: Problem with regular expressions!!!

2003-03-18 Thread drieux
On Tuesday, Mar 18, 2003, at 15:46 US/Pacific, Peter Kappus wrote: I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... [..] I think the OP may have a problem with wh

Re: Problem with regular expressions!!!

2003-03-18 Thread Wiggins d'Anconia
Hughes, Andrew wrote: This is a newbie observation, but aren't you not supposed to name one of your own variables with a number as the first value after a $, @, or % as in the case of $2? Could this be part of the problem? Just to make sure this doesn't slip through, in his case $2 refers to th

RE: Problem with regular expressions!!!

2003-03-18 Thread Peter Kappus
I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... -Peter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Problem with regular expressions!!!

2003-03-18 Thread Marcelo Taube
ll keep looking at it. A questio: Should the 'split' version of the same code be faster? Original Message Follows From: "Kipp, James" <[EMAIL PROTECTED]> To: "'Marcelo Taube'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: RE: Problem

Re: Problem with regular expressions!!!

2003-03-18 Thread Rob Benton
It looks odd to me b/c * and ? are both quantifiers which usually triggers an error when you try to run it. See if this works for you: $file_completename =~ /([^.]*)\.(.*)/; On Tue, 2003-03-18 at 15:28, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working proper

Re: Problem with regular expressions!!!

2003-03-18 Thread Brett W. McCoy
On Tue, 18 Mar 2003, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working properly and > i don't understand why!! > > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! >

RE: Problem with regular expressions!!!

2003-03-18 Thread Kipp, James
> > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! > } > # did u turn on warnings and use strict ?? did you catch the ] at the end of $extension? i tried this on

RE: Problem with regular expressions!!!

2003-03-18 Thread Hughes, Andrew
esday, March 18, 2003 4:29 PM To: [EMAIL PROTECTED] Subject: Problem with regular expressions!!! As u probably have guessed some part of my code is not working properly and i don't understand why!! This is the code. # $file_completename =~ /(.*?)\.(.*)/;

Problem with regular expressions!!!

2003-03-18 Thread Marcelo Taube
As u probably have guessed some part of my code is not working properly and i don't understand why!! This is the code. # $file_completename =~ /(.*?)\.(.*)/; if ($2 eq $extension]) { #DO SOMETHING!!! } # As u see, i'm trying

Re: Mastering Regular Expressions?

2002-06-10 Thread Octavian Rasnita
Hi thank you. I have talked with Lenny Muellner from O'Reilly because I am blind and they offer the books for free for the blind, but even though he gave me the books I've asked for free, he told me that he has not the book "Mastering Regular Expressions" available. Ted

Re: At least a number of characters - regular expressions

2002-06-10 Thread Janek Schleicher
Octavian Rasnita wrote at Sun, 09 Jun 2002 08:42:34 +0200: > Hi all, > > I want to check if in a string there are more than 3 capital letters. I've tried >using: > > if ($string=~ /[A-Z]{3,}/) { > > } > } > This match at least 3 capitals only if they are one after another. I want to check

Re: Mastering Regular Expressions?

2002-06-09 Thread David T-G
Teddy -- ...and then Octavian Rasnita said... % % Hi all, Hello! % % Do you know if there is an electronic version of "Mastering Regular % Expressions" book that I can find? Other than the CD version, also for sale from ORA, probably not; it's a still-in-print book that

Re: At least a number of characters - regular expressions

2002-06-09 Thread David T-G
Teddy -- ...and then Octavian Rasnita said... % % Hi all, Hello! % % I want to check if in a string there are more than 3 capital letters. % I've tried using: % % if ($string=~ /[A-Z]{3,}/) { ... % % For example, I want to match this string: "AxxxBxxxCxxx". That's not so bad: [zero] [9

Mastering Regular Expressions?

2002-06-09 Thread Octavian Rasnita
Hi all, Do you know if there is an electronic version of "Mastering Regular Expressions" book that I can find? Thank you very much! Teddy, [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

At least a number of characters - regular expressions

2002-06-09 Thread Octavian Rasnita
Hi all, I want to check if in a string there are more than 3 capital letters. I've tried using: if ($string=~ /[A-Z]{3,}/) { } This match at least 3 capitals only if they are one after another. I want to check if the string contains at least 3 capitals, doesn't matter how are they position

RE: Replacing with Regular expressions

2002-06-04 Thread Janek Schleicher
Scot Robnett wrote at Tue, 04 Jun 2002 16:46:26 +0200: >> He said he wanted to replace all nonalphanumerics, and I was assuming that meant >white space as >> well, regardless of where in the string it is located. >> >> Scot > >>> $foo =~ s/\W*/_/g; >>> >>> http://www.oreilly.com/catalo

RE: Replacing with Regular expressions

2002-06-04 Thread Scot Robnett
] Subject: RE: Replacing with Regular expressions Scot Robnett wrote at Tue, 04 Jun 2002 05:13:13 +0200: >> $foo =~ s/\W*/_/g; >> >> http://www.oreilly.com/catalog/regex/ > ... > > I want to allow only the a-z, A-Z, and 0-9 characters and I want to replace all o

RE: Replacing with Regular expressions

2002-06-04 Thread Janek Schleicher
Scot Robnett wrote at Tue, 04 Jun 2002 05:13:13 +0200: >> $foo =~ s/\W*/_/g; >> >> http://www.oreilly.com/catalog/regex/ > ... > > I want to allow only the a-z, A-Z, and 0-9 characters and I want to replace all >others with _ when > writing the file to the server. > > Can you tell m

RE: Replacing with Regular expressions

2002-06-03 Thread Scot Robnett
$foo =~ s/\W*/_/g; http://www.oreilly.com/catalog/regex/ -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 3:06 AM To: [EMAIL PROTECTED] Subject: Replacing with Regular expressions Hi all, I have a path to a file name

Replacing with Regular expressions

2002-06-03 Thread Octavian Rasnita
Hi all, I have a path to a file name. (In a script for uploading files). I want to allow only the a-z, A-Z, and 0-9 characters and I want to replace all others with _ when writing the file to the server. Can you tell me what would be this regular expression? Thank you. Teddy, [EMAIL PROTECTED

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 r

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

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 expres

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: 2 regular expressions

2002-02-28 Thread fliptop
GsuLinuX wrote: > How can i convert > > 1. " $a = 29.7548925547539 > $a = 29.75 " i'd use printf: my $a = 29.7548925547539; printf "%5.2f\n", $a; # this prints 29.75 > 2. " $b = 2345342 --> $b = 2,345,342" look into numbe

2 regular expressions

2002-02-28 Thread GsuLinuX
Hi from İstanbul, How can i convert 1. " $a = 29.7548925547539 > $a = 29.75 " 2. " $b = 2345342 --> $b = 2,345,342" thanx Derya Istanbul

Escaping special characters for regular expressions

2002-02-27 Thread W P
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 the contents as the first string. Ho

[ADMIN REDIRECT] Re: Regular Expressions

2002-02-20 Thread Kevin Meltzer
o me what that regular > expression means. It is kind of an emergency. > > And, if someone knows a link where there is more information about regular > expressions, I would be grateful. > > Thanks in advance. > > Lilian -- [Writing CGI Applications with Perl - http

Regular Expressions

2002-02-20 Thread Lilian Alvarenga Caravela Godoy
are replacing some things but cannot understand what. Specially the second one. I would really appreciate if somebody could explain to me what that regular expression means. It is kind of an emergency. And, if someone knows a link where there is more information about regular expressions, I would be

Re: regular expressions

2002-02-07 Thread Shawn
- Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 4:37 PM Subject: regular expressions > Hi all, > Do you know where I can find a good free tutorial or manual for the regular > e

regular expressions

2002-02-07 Thread Octavian Rasnita
Hi all, Do you know where I can find a good free tutorial or manual for the regular expressions in Perl? Thank you. Teddy, My dear email address is [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http