Re: A regex problem?

2012-08-13 Thread Andy Bach
On Mon, Aug 13, 2012 at 5:42 AM, Owen wrote: > I have a web form with a text area that I feed back through a cgi > script and "filter" the text with; > > $q1_elaborate =~ s/[^[:alpha:]' .-]//g; > quotemeta($q1_elaborate); > > However, it removes line feeds as well, so maybe that code is not al

Re: A regex problem.

2004-11-09 Thread William C. Bruce
[EMAIL PROTECTED] (Denham Eva) wrote in news:[EMAIL PROTECTED]: > Hello Gurus, > In a script I have a piece of code as such:- > * snip** > my $filedate =~ s/(\d+)//g; > * snip end *** > The data I am parsing looks as such :- > ** DATA >

Re: A regex problem.

2004-09-06 Thread Ing. Branislav Gerzo
Denham Eva [DE], on Monday, September 6, 2004 at 14:41 (+0200) typed: DE> my $filedate =~ s/(\d+)//g; DE> ** DATA DE> C:/directory/MSISExport_20040814.csv DE> C:/directory/MSISExport_20040813.csv DE> Can someone help me with that regex? I am having a frustrating time of I hop

Re: A regex problem.

2004-09-06 Thread Gunnar Hjalmarsson
Jaffer Shaik wrote: Try in this way. Just remove "my", you will get it. What kind of stupid advice is that? $filedate = "C:/directory/MSISExport_20040814.csv"; ($filedate) =~ s/(\_\d+)//g; Left aside that the parentheses are redundant, that does the opposite of what the OP asked for. -- Gunnar Hj

Re: A regex problem.

2004-09-06 Thread Flemming Greve Skovengaard
Denham Eva wrote: Hello Gurus, In a script I have a piece of code as such:- * snip** my $filedate =~ s/(\d+)//g; Try this instead: my $filedate; if( $var_with_file_name =~ m/(\d+)\.csv$/ ) { $filedate = $1; } print "$filename\n"; * snip end **

RE: A regex problem.

2004-09-06 Thread Jaffer Shaik
Hi, Try in this way. Just remove "my", you will get it. $filedate = "C:/directory/MSISExport_20040814.csv"; ($filedate) =~ s/(\_\d+)//g; print "$filedate\n"; Thank you jaffer -Original Message- From: Denham Eva [mailto:[EMAIL PROTECTED] Sent: Monday, September 06, 2004 6:11 PM To: [EMAI