Regular Expression

2004-11-21 Thread Anish Kumar K.
Hi Suppose there is a line my $line= "[Create User]"; I wanted to get the text "Create User from this line..How will I use regular expresion to extract it... the condition is [TEXT NAME] I want only the text name from the pattern..I used $2 and all but no hope... Anish

regular expression

2001-06-02 Thread chris robinson
I need to write a regular expression to eliminate any lines in a text = file that start with a #. how would I do this. Many Thanks

Regular Expression

2001-06-04 Thread Satheesh Ramakrishnan
All, How do I assign 1298b to some scalar variable from the string below. context_config_file = "1298b"; Thanks, Satheesh.

regular expression

2001-08-03 Thread Messervy, Joe M
I wrote a small script that goes on to various machines greps for certain events and logs them (I am using plain shell scripting for this). I need to know what machine these events occur so I did an echo $host >> myfile then echo grep results >> myfile. Now I want to call a perl script that wil

regular expression

2003-01-31 Thread Shah, Urmil
I am trying to replace value after say Treal; -200mV; with just Treal; in the below string Strings in a File: -- {3504} V125_out_V_5ma_LFL := Treal; V125_out_V_5ma_UFL := Treal; {$3505} V125_out_Impedance_UFL := Treal; { 4130} Filter_offset_11M_LFL := Tr

Regular Expression

2003-07-15 Thread Nick Diel
I am having a hard time getting a regular expression to work the way i want it to. Take the following text: bla bla bla (la la) bla bla (di da) I want to extract the la la to one variable and di da to antoher variable. What I have tried so far is using match variables, but so far I am only able

regular expression

2002-08-12 Thread LADDO
/usersA2F.0.5_1027468994_24 var/backup/usersA2F.0.6_1027468994_24 i want a regular expression that can find only the third part i.e only usersA2F.0.1_1027468994_24 with awk i can do it easily like cat {thisfile} | awk -F'/' [{print $3 }'

regular expression

2002-08-21 Thread Javeed SAR
Hi all, @file=`ls $ja`; #Here the output is a list of files: cp.exe eula.txt test2.vbp.mkelem test3.vbp # I want to grep for files with .dsp or .vbp extensions here, if the number of files with extension .dsp or .vbp is > 1 i should exit saying project exists. or else send mail. am i do

Regular expression

2002-09-12 Thread Javeed SAR
I have a statement as follows; I need to split them into 3 parts; * test_merge1 \\blrk35ed\views\test_merge1.vws LIke this: $var1 should have * $var2 should have test_merge1 $var3 should have \\blrk35ed\views\test_merge1.vws TIA Jav

Regular Expression

2002-09-24 Thread Brian Ling
Hi Does anyone know how to save any data that is matched by regular expression, from within a string or array, the match could occur any number of times. I can happily discard any matched data, but not the other way round. Help this is driving me up the wall, I'm sure there is an easy a

Regular expression

2002-10-04 Thread Javeed SAR
I have the following output in array @attt I want the last line in a variable $out. What should the regular expression be? attribute type "SYNC_CHECK" created 04-Oct-02.09:36:42 by javeed.clearuser@BLRK35ED "for testing" owner: HIS\javeed group: HIS\clearus

regular expression

2002-10-18 Thread Mandar Rahurkar
Hi, I am trying to write a regular expresssion which reads as : from the list of following files generate a list which does not start with 150d in the beginning: 150d1.fea 157a6.fea 170c5.fea 2168f5.fea this is how i am trying to do it now : where $no="150d"; <-- this has to be variable @lis

regular expression

2004-05-28 Thread Mandar Rahurkar
Hi, I am trying to remove from file : 1. all characters but any alphabet and numbers. 2. all trailing spaces should be made to one space. following code doesnt seem to work for objective [1] mentioned above. Can anyone please point out why ? Thanks, Mandar --- open(fp,$

regular expression

2004-06-09 Thread Mandar Rahurkar
Hi, I am looking for URL's that end in .html OR .htm or / if($URL =~ /[.html$|.htm$|\/$]/) { #do somthing } whats wrong with the above expression ? Mandar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Regular Expression

2002-02-21 Thread Lilian Alvarenga Caravela Godoy
Hi everyone I am trying to learn Perl looking into some scripts. One of them has a regular expression inside. First of all, I need to know what two specific lines are doing. The code is bellow. $req =~ s/\r//g ; $req =~ s/([^\n]{72,72})\n([^\n]{1,71})\n([^\n]{1,71})$/$1\n$2$3/ I know they

regular expression

2011-04-28 Thread Irfan Sayed
hi, i have following code. $target = "abc,xyz"; print "$target\n"; $target =~ s/,/\s/g; print "$target\n"; i need to replace "comma" with whitespace for string "abc,xyz" the output shud be "abc xyz" the above regular expression does not do that . please suggest --irfan

regular expression

2007-05-04 Thread xavier mas
HI list!, I have a file with labels and a small text inside. When this text is different of a pattern text (n, for instance), this label must be deleted, for instance: f(more text)n(more text)mpl... (labels containing something different to 'n' must be deleted of the string.) How can I do thi

regular expression

2007-05-07 Thread Sarthak Patnaik
f (/Match/)&&(!/Match Not/)' But I want to do that inside one regular expression. Regards, Sarthak Disclaimer This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you hav

Regular expression

2007-10-19 Thread Sayed, Irfan (Irfan)
Hi All, I have one string aic_8.0@/vobs/pvob_aic which is stored in one variable $project Now I need only that part of that string which is before @ so I have written following regular expression to achieve this... my ($pvob) = ($project =~ m{(.+)@}); and with the help of this reg. exp. I am

Regular Expression

2006-11-02 Thread ppp ppp
Hi All, I want enter a regex through command line and , my program should find the regex from the file that I should suppy through comman dline example C:\> perl myperl.pl regex 1.txt where regex is ths --> the pattern what I want to find in the 1.txt . my progr

regular expression

2007-02-06 Thread Sayed, Irfan \(Irfan\)
Hi All, Following is my code # /usr/bin/perl use strict; use warnings; my $CT = "/usr/atria/bin/cleartool"; my @vob_list = `$CT lsvob -s`; my $ele; my @vob_list1; my $i; my $size; $size = $#vob_list+1; for ($i=0;$i<=$size;$i++) { $ele = $vob_list[$i]; $ele =~ s/$ele/"$ele",/g; $vob_l

regular expression

2005-05-03 Thread Greg Sheridan
Hi everyone, I'm new to this list and I have a very basic question about regular expressions. I inherited a Perl script, and I'm trying to figure out what a specific line does. Here's the line: $dose_density =~ s/[A-Za-z\/ ]//g; Any help would be greatly appreciated. Thanks, Greg

regular expression

2005-12-29 Thread Krishna . Thotakura
I am looking for help on a PERL regular expression that can do the following: 1. Make sure that the string is 20 chars or else match should fail. 2. The string can have word characters or spaces or comma(,), hyphen(-), ampersand(&) characters. 3. If the string contains only spaces, then m

regular expression

2006-02-20 Thread itzik brown
Hi, is there a better way to do this: if ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/o) tnx, itzik

regular expression

2014-05-06 Thread Danny Wong (dannwong)
Hi Guys, I have the following strings. my $str1="^Modifications made by Danny Wong (danwong) on 2014/05/06 18:27:48 from database brms"; #$str1="^Modifications made by danwong on 2014/05/06 18:27:48 from database brms²; What is a regular expression where I can extract

regular expression

2019-09-08 Thread Mike
You are not doing anything with $t to test whether it works.  Also you are not telling us what data you might test it with. Mike On 9/8/2019 6:41 PM, Jim Gibson wrote: On Sep 8, 2019, at 3:39 PM, Mike wrote: I expect it to return a positive value if $t contains a number anywhere within i

Regular expression help

2004-10-21 Thread Owen
This program #!/usr/bin/perl -w use strict; while () { chomp; my $line = $_; my @y =split (/\b[\w]+:/,$line); #print scalar(@y); print $line; print "\n\$y[0] $y[0]\n\$y[1] $y[1]\n\$y[2] $y[2]\n\$y[3] $y[3]\n\$y[4] $y[4]\n\$y[5] $y[5]\n"; } __DATA__ M:356 358 386 R:#132 W1:319 NRT:32 R:#1

Reg..Regular expression

2004-11-10 Thread arjun.mallik
Hi Frnds, I need to extract a string from every line of a file which are present in a array. The string to be extracted is present in between double quotes. I am using below code and it is not working. == foreach $line2 (@objects) { chomp($line2); <--- To

Re: Regular Expression

2004-11-22 Thread Owen Cook
On Mon, 22 Nov 2004, Anish Kumar K. wrote: > Suppose there is a line > my $line= "[ class=\"[%um_class1%]\" [%um_master=createUserCourse%]>Create User]"; > > I wanted to get the text "Create User from this line..How will I use regular > expresion to extract it... > > the condition is > > [TEX

Re: Regular Expression

2004-11-22 Thread Renqilong
Just try the expression: $line =~ /.*]>(.*)<.*)/ On Mon, 22 Nov 2004 13:29:10 +0530 "Anish Kumar K." <[EMAIL PROTECTED]> wrote: > Hi > > Suppose there is a line > my $line= "[ class=\"[%um_class1%]\" [%um_master=createUserCourse%]>Create User]"; > > I wanted to get the text "Create User from t

regular expression question

2005-01-17 Thread Vincent
Hi all, I am new to perl, I receive some spam email with subject like "st0ck, 0pportunities, gr0wth...", how can I match those words with number "0" in Thanks in advance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Regular expression matching

2005-02-02 Thread Tommy Nordgren
I have the need to generate and match a large number (Typically 50 - 200) of regular expressions. Each regular expression should be written in a subset of the perl regular expression syntax, or another suitable syntax. I have not committed to a specific subset yet. The patterns are not allowed

regular expression match?

2001-04-16 Thread Prentice, Phillip R
6_" $array{2} = "clk_out" I want to create a regular expression which will match $array{1} and not the others in the array. This is what I have so far. foreach (@array) { if(m/$\w+\_/) { print "Matched, $_\n"; } } This isn't giving the results I want, inste

Re: regular expression

2001-06-02 Thread Chas Owens
th # as the first character you can # use /^#/ } On 02 Jun 2001 18:14:56 +1000, chris robinson wrote: > I need to write a regular expression to eliminate any lines in a text = > file that start with a #. how would I do this. > > Many Thanks > -- Today is Pu

Re: regular expression

2001-06-02 Thread chris robinson
t; <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 02, 2001 6:35 PM Subject: Re: regular expression > in unix you can just use "grep -v '^ *#' filename > filename.new" > > the equivalent perl code would look like this > > #!/usr/bin/

Re: regular expression

2001-06-02 Thread Chas Owens
if $word =~ /^\#/ > ; > > have i got the final line right to ignore any lines that begin with a #?? > > thanks, > Chris > - Original Message - > From: "Chas Owens" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday

Re: Regular Expression

2001-06-04 Thread Jeff Pinyan
On Jun 4, Satheesh Ramakrishnan said: >How do I assign 1298b to some scalar variable from the string below. > >context_config_file = "1298b"; You probably want to use a hash of configuration variables, not a lot of scalars. There are modules for parsing simple config files, but if you want to d

Re: Regular Expression

2001-06-04 Thread ISO-8859-1
One way is $string = 'context_config_file = "1298b";'; $string =~ /"(.*)"/; $data = $1; On 04 Jun 2001 13:41:03 -0400, Satheesh Ramakrishnan wrote: > All, > > How do I assign 1298b to some scalar variable from the string below. > > context_config_file = "1298b"; > > Th

Re: Regular Expression

2001-06-04 Thread Mathew Hennessy
Satheesh Ramakrishnan wrote: > > All, > > How do I assign 1298b to some scalar variable from the string below. > > context_config_file = "1298b"; this is probably a cookbook, but ## require 5; # for (.*?) rege

Re: Regular Expression

2001-06-06 Thread rob chanter
On Mon, Jun 04, 2001 at 01:48:15PM -0400, Jeff Pinyan wrote: > > 2. use a regex to get the key and value: > Just a tiny refinement. My usual config file stuff is: > while () { chomp; s/\s+#.*//; #strip trailing comments > next if /^#/; # skip commented lines next if /

Re: regular expression

2001-08-02 Thread Jeff 'japhy/Marillion' Pinyan
On Aug 2, Messervy, Joe M said: >I want to get rid of machine1, machine2, and machine4 as there were no >matching logs for these events. >I tried as a test perl -p -i -e 's//nmachine//g' myfile and get the >following error: >Illegal division by zero at -e line 1, <> line 1. (and all data is los

RE: regular expression

2001-08-03 Thread Jeff 'japhy/Marillion' Pinyan
On Aug 2, Messervy, Joe M said: >Ok, I feel stupid the test should have been perl -p -i -e 's/\nmachine//g' >myfile ... but it still doesnt work :( Well, $_ is only ONE LINE of the file. So it can't possibly start with a newline and then have other text. Perhaps you want s/^machine//; --

Re: regular expression

2003-01-31 Thread John W. Krahn
Urmil Shah wrote: > > I am trying to replace value after say Treal; -200mV; with just Treal; in > the below string > > Strings in a File: > -- > {3504} V125_out_V_5ma_LFL := Treal; V125_out_V_5ma_UFL := > Treal; > {$3505} V125_out_Impedance_UFL := Treal;

RE: regular expression

2003-01-31 Thread Shah, Urmil
Yes i tried but not working it gives error for (?<= sequence not found, when i remove the ?<= it does nothing.. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 6:06 PM To: [EMAIL PROTECTED] Subject: Re: regular expression Urmi

Re: regular expression

2003-01-31 Thread John W. Krahn
Urmil Shah wrote: > > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > > Urmil Shah wrote: > > > > $str =~s/\s+\bTreal\b\;(\d+\w+)\;/Treal;/g > > > > but not working..any idea > > This might work (not tested): > > $str =~ s/(?<= := Treal;) [+-]?\d+mV;//g > > Yes i tried but not working it give

Regular expression problem.

2003-07-05 Thread Pandey Rajeev-A19514
Hi, Can anyone give me a regular expression(perhaps a one liner) ? Matching an expression in a single line is easy. But if I have to find it out in a array of scalars, it becomes tricky for me. An excerpt of my output buffer looks like this

regular expression replacement

2003-07-12 Thread Ramprasad
if I have my $str = 'aw bcdefaw e a rt zzz kjkjkjaw qa' ; If I wish to replace everything between 'a' and 'zzz' With 'TXT' I do $str=~s/a[^a]+zzz/aTXTzzz/; This works fine. Now if I wish to replace everything between 'aw' and 'zzz' with 'TXT' I am not able to use $str=~s/aw[^(aw)]+zzz/awTXTzzz/; I

RE: Regular Expression

2003-07-15 Thread Bob Showalter
Nick Diel wrote: > I am having a hard time getting a regular expression to work the way > i want it to. Take the following text: bla bla bla (la la) bla bla > (di da) > > I want to extract the la la to one variable and di da to antoher > variable. What I have tried so

RE: Regular Expression

2003-07-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nick Diel wrote: > I am having a hard time getting a regular expression to work the way > i want it to. Take the following text: bla bla bla (la la) bla bla > (di da) > > I want to extract the la la to one variable and di da to antoher > variable. What I have tried so

Re: Regular Expression

2003-07-15 Thread Paul D. Kraus
> I am having a hard time getting a regular expression to work the way i want > it to. Take the following text: bla bla bla (la la) bla bla (di da) my ( $var1, $var2 ) = ( $1, $2 ) if /$inputstring =~ m/bla bla bla (la la) bla bla (di da) $1 gets la la $2 gets di da -- To unsubscr

Re: Regular Expression

2003-07-16 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Paul D. Kraus wrote: >> I am having a hard time getting a regular expression to work the way i > want >> it to. Take the following text: bla bla bla (la la) bla bla (di da) > > my ( $var1, $var2 ) = ( $1, $2 ) if /$inputstring =~ m/bl

Re: Regular Expression

2003-07-16 Thread Janek Schleicher
Nick Diel wrote at Tue, 15 Jul 2003 11:12:18 -0600: > I am having a hard time getting a regular expression to work the way i want > it to. Take the following text: bla bla bla (la la) bla bla (di da) > > I want to extract the la la to one variable and di da to antoher variable. &

Regular Expression Problems?

2002-07-19 Thread Carrie Lyn Brammer
nyway, if one of you kind souls could please take a quick glance at the script below, I would appreciate the feedback. I was thinking, perhaps its a problem with the regular expression and how the scalar variables are presented... I dunno *shrug

Greedy Regular Expression

2002-07-26 Thread Elliott, Don (Police)
Hi, I'm having some trouble trying to easily remove lines from a data file using a regular expression. I can do it by reading the file in a line at a time then deciding whether to chuck it or write it out. My data looks something like this - ENQ:SIMS RE:ELLIOTT,DONALD ELLIOTT,DONALD,LAW

Re: regular expression

2002-08-12 Thread Janek Schleicher
; var/backup/usersA2F.0.4_1027468994_24 > var/backup/usersA2F.0.5_1027468994_24 > var/backup/usersA2F.0.6_1027468994_24 > > i want a regular expression that can find only the third part i.e only > usersA2F.0.1_1027468994_24 Don't you want to find the filename

Re: regular expression

2002-08-12 Thread John W. Krahn
2F.0.3_1027468994_24 > var/backup/usersA2F.0.4_1027468994_24 > var/backup/usersA2F.0.5_1027468994_24 > var/backup/usersA2F.0.6_1027468994_24 > > i want a regular expression that can find only the third part i.e only > usersA2F.0.1_1027468994_24 > > with awk i can do it easily

Re: regular expression

2002-08-13 Thread Jeff 'japhy' Pinyan
On Aug 13, Janek Schleicher said: >Laddo wrote at Tue, 13 Aug 2002 06:31:24 +0200: > >> var/backup/usersA2F.0.1_1027468994_24 >> >> i want a regular expression that can find only the third part i.e only >> usersA2F.0.1_1027468994_24 > >Of course, you can

Re: regular expression

2002-08-13 Thread Jeff 'japhy' Pinyan
On Aug 12, John W. Krahn said: >cat {thisfile} | perl -F'/' -ane'print $F[2]' Useless use of 'cat', and you're missing a newline (which I assume you'd want). perl -F/ -lane 'print $F[2]' FILES... or perl -F/ -pale '$_ = $F[2]' FILES... -- Jeff "japhy" Pinyan [EMAIL PROTECTED]

AW: regular expression

2002-08-13 Thread Hughes, James
PROTECTED] -Ursprungliche Nachricht- Von: LADDO [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 13. August 2002 06:31 An: [EMAIL PROTECTED] Betreff: regular expression Hi all Iam new to perl so please bear with me i have a log file that i open to extract some information from file is

Re: regular expression

2002-08-16 Thread Janek Schleicher
Jeff 'Japhy' Pinyan wrote at Tue, 13 Aug 2002 15:44:02 +0200: >>Of course, you can also use a regexp: >>m:/(.*?)$/ > > That regex should read m:/(.*?)$:, but it's still broken. The .*? doesn't > mean "match the shortest chunk possible", just "TRY matching as little as > possible". The regex wi

Re: regular expression

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 08:02:02 GMT, [EMAIL PROTECTED] (Javeed Sar) wrote: > # I want to grep for files with .dsp or .vbp extensions here, > if the number of files with extension .dsp or .vbp is > 1 i > should exit saying project exists. or else send mail. > > am i doing the right thing? No y

regular expression help....

2002-09-11 Thread Steve
I have the following line in a log file: 09-07-2002 11:39:25.95 - Microsoft Dial Up Adapter log opened. The date and time will always change but the after that it's always consistent (well opened will sometimes be closed) I need to get the entire date in a variable and the entire time in a va

Re: Regular expression

2002-09-12 Thread Thanatos
Javeed SAR wrote: > > I have a statement as follows; > I need to split them into 3 parts; > > * test_merge1 \\blrk35ed\views\test_merge1.vws > > > LIke this: > $var1 should have * > $var2 should have test_merge1 > $var3 should have \\blrk35ed\views\test_merge1.vws > > > > TIA > >

Re: Regular expression

2002-09-12 Thread George P.
On Fri, 13 Sep 2002, Javeed SAR wrote: > > > I have a statement as follows; > I need to split them into 3 parts; > > * test_merge1 \\blrk35ed\views\test_merge1.vws > > > LIke this: > $var1 should have * > $var2 should have test_merge1 > $var3 should have \\blrk35ed\views\test_merge1.vw

Re: Regular expression

2002-09-12 Thread John W. Krahn
Javeed Sar wrote: > > I have a statement as follows; > I need to split them into 3 parts; > > * test_merge1 \\blrk35ed\views\test_merge1.vws > > LIke this: > $var1 should have * > $var2 should have test_merge1 > $var3 should have \\blrk35ed\views\test_merge1.vws $_ = '* test_merge1

Re: Regular expression

2002-09-12 Thread nyec
On Thursday 12 September 2002 08:11 pm, Javeed SAR wrote: > I have a statement as follows; > I need to split them into 3 parts; > > * test_merge1 \\blrk35ed\views\test_merge1.vws > > > LIke this: > $var1 should have * > $var2 should have test_merge1 > $var3 should have \\blrk35ed\views\t

Re: Regular Expression

2002-09-24 Thread Sudarshan Raghavan
On Tue, 24 Sep 2002, Brian Ling wrote: > Hi > > Does anyone know how to save any data that is matched > by regular expression, from within a string or array, > the match could occur any number of times. > > I can happily discard any matched data, but not the > other w

Re: Regular Expression

2002-09-24 Thread Jeff 'japhy' Pinyan
On Sep 24, Brian Ling said: >Does anyone know how to save any data that is matched >by regular expression, from within a string or array, >the match could occur any number of times. push @matches, $string =~ /pattern/g; I *think* that's what you want... you're being a litt

Regular Expression help

2002-09-24 Thread Shaun Bramley
Hi all. I am hoping that someone can help me determine what is wronf with my regualr expression. background info: @array contains 'text', numbers, INT, or TINYINT. I am trying to identify if the array element is a number. What I have right now is: if($array[$x] =~ /\d{1,3}?/) { do somethi

RE: Regular expression

2002-10-04 Thread Javeed SAR
Hi All, I have the following output in array @attt I want the last line, in this output (SYNC_CHECK = "HELLO") in a variable $out. What should the regular expression be? attribute type "SYNC_CHECK" created 04-Oct-02.09:36:42 by javeed.clearuser@BLRK35ED "for tes

Re: Regular expression

2002-10-04 Thread Robin Cragg
Hi Javeed , the last element of the array is $attt[$#attt]. If you have one line per element, that should do it. R At 14:24 04/10/2002 +0530, Javeed SAR wrote: >I have the following output in array @attt >I want the last line in a variable $out. >What should the regular expr

Re: Regular expression

2002-10-04 Thread Bruno Negrao - Perl List
> Hi Javeed , > > the last element of the array is $attt[$#attt]. If you have one line per > element, that should do it. Right. This is the easiest way. But, just to answer him, what he could do using regular expression could be something like: foreach (@attt) { /=/ &&am

Re: Regular expression

2002-10-07 Thread Bruno Negrao - Perl List
ll kisses, Bruno Negrão. - Original Message - From: Javeed SAR To: Bruno Negrao - Perl List Sent: Monday, October 07, 2002 1:21 AM Subject: RE: Regular expression foreach (@attt) { /=/ && ( ($out) = (split (/=/))[1] ); } Can u explain this statem

Re: Regular expression

2002-10-07 Thread Mark Crowston
ses, Bruno Negrão. - Original Message - From: Javeed SAR To: Bruno Negrao - Perl List Sent: Monday, October 07, 2002 1:21 AM Subject: RE: Regular expression foreach (@attt) { /=/ && ( ($out) = (split (/=/))[1] ); } Can u explain this statement to m

Re: regular expression

2002-10-18 Thread Jeff 'japhy' Pinyan
[please don't top-post -- it makes the discussion difficult to follow] On Oct 17, Mandar Rahurkar said: >On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > >> On Oct 17, Mandar Rahurkar said: >> >> >Hi, >> > I am trying to write a regular expresssion which reads as : >> >from the list of followin

Re: regular expression

2002-10-18 Thread Mandar Rahurkar
On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > [please don't top-post -- it makes the discussion difficult to follow] > > On Oct 17, Mandar Rahurkar said: > > >On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > > > >> On Oct 17, Mandar Rahurkar said: > >> > >> >Hi, > >> > I am trying to write

Re: regular expression

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Mandar Rahurkar said: >> >> @new = grep { ! /^$no/ } @list; >> >> @new = grep !/^\Q$no/, @list; >> > >> >thanks for your prompt reply...however this does not work.. >> >program does not generate any output... >> >> What program? Please show us the code you're (now) using. > >$spkr=

Re: regular expression

2002-10-18 Thread Mandar Rahurkar
On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > On Oct 17, Mandar Rahurkar said: > > >> >> @new = grep { ! /^$no/ } @list; > >> >> @new = grep !/^\Q$no/, @list; > >> > > >> >thanks for your prompt reply...however this does not work.. > >> >program does not generate any output... > >> > >> W

Re: regular expression

2002-10-18 Thread Jeff 'japhy' Pinyan
On Oct 17, Mandar Rahurkar said: >Hi, > I am trying to write a regular expresssion which reads as : >from the list of following files generate a list which does not start >with 150d in the beginning: >@new= grep {/[^{no}]/} @list; First, you've got a character class [^...]. You don't want that

Re: regular expression

2002-10-18 Thread Mandar Rahurkar
thanks for your prompt reply...however this does not work.. program does not generate any output... -Mandar On Thu, 17 Oct 2002, Jeff 'japhy' Pinyan wrote: > On Oct 17, Mandar Rahurkar said: > > >Hi, > > I am trying to write a regular expresssion which reads as : > >from the list of following f

Newbie: regular expression

2004-05-03 Thread Durai
Hello All, I am having the following lines of code to remove "\n" from string. $_="Hi. \n This is test string"; s/ (\n) /HI /xisg; print; I expected the output like: Hi. HI This is test string But I got: Hi. HI This is test string Anything wrong? Regs, Durai. --- Outgoing mail is c

Re: regular expression

2004-05-28 Thread James Edward Gray II
On May 28, 2004, at 8:31 PM, Mandar Rahurkar wrote: Hi, I am trying to remove from file : 1. all characters but any alphabet and numbers. tr/A-Za-z0-9//cd; # should handle that 2. all trailing spaces should be made to one space. I'm not 100% sure I understand this, but I'm gues

Re: regular expression

2004-05-28 Thread Beau E. Cox
On Friday 28 May 2004 03:31 pm, Mandar Rahurkar wrote: > Hi, >I am trying to remove from file : > 1. all characters but any alphabet and numbers. > 2. all trailing spaces should be made to one space. > >following code doesnt seem to work for objective [1] mentioned above. >

Re: regular expression

2004-05-28 Thread John W. Krahn
"Beau E. Cox" wrote: > > On Friday 28 May 2004 03:31 pm, Mandar Rahurkar wrote: > > > > for(@cont) { > > tr/A-Z/a-z/; > > You forgot the 'g': >tr/A-Z/a-z/g; tr/// doesn't have a /g option. perldoc perlop John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: regular expression

2004-05-28 Thread Beau E. Cox
On Friday 28 May 2004 05:47 pm, John W. Krahn wrote: > "Beau E. Cox" wrote: > > On Friday 28 May 2004 03:31 pm, Mandar Rahurkar wrote: > > > for(@cont) { > > > tr/A-Z/a-z/; > > > > You forgot the 'g': > >tr/A-Z/a-z/g; > > tr/// doesn't have a /g option. > > perldoc perlop OK. I was thinking

Re: regular expression

2004-06-09 Thread James Edward Gray II
On Jun 9, 2004, at 6:46 PM, Mandar Rahurkar wrote: Hi, I am looking for URL's that end in .html OR .htm or / $URL =~ m/(?:\.html?|\/)$/ That should do it. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regular expression

2004-06-10 Thread Mike Flannigan
> Subject: regular expression > Date: Wed, 9 Jun 2004 18:46:30 -0500 (CDT) > From: Mandar Rahurkar <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED] > > Hi, >I am looking for URL's that end in .html OR .htm or / > > if($URL =~ /[.html$|.htm$|\/$]/) { >

regular expression- help

2004-06-18 Thread jack jack
Hi All, I have 2 variables $last_accessed and $owner_line $last_accessed=": Last accessed 20-Apr-04.12:57:30 by [EMAIL PROTECTED]"; $owner_line="Owner: opc_bld : rwx (all)"; -From $last_accessed i want the foll output in variables : $view_day=20 $view_month=Apr $view_year=04 -From

regular expression question

2004-07-02 Thread Graeme McLaren
Afternoon all, I'm trying to to a regular expression to search and replace + with \+ I need to escape the + because it is getting used as an operator instead of a literal string, this is what I have so far: $terms[$i] =~ s/\+ /\ \\\+/g; Basically the result of searching for c++ should r

Regular expression help

2003-08-18 Thread EUROSPACE SZARINDAR
Hi, I tried to write a script to extrat data from the given DATA but I can find the right regular expression to do that. RULE: I need to catch everything between quotes (single or double) and if inside exists a repeated quote (single or double) it is not seen as end of the match. #!/usr/bin

Regular Expression Problems

2003-09-15 Thread Anthony J Segelhorst
I am trying to use a regular expression to find an error in web page. I am matching the content using /error/i currently. This became a problem when the word terrorists was posted on the site because the word error exists in the work terrorists. How can I use a regular expression to match

Regular Expression question

2003-10-09 Thread Trina Espinoza
How do you create a regular expression that allows you to have files like ths: Stuff_Dev Greg_Files myThings_ _default I wrote this s/([A-Za-z]*)/\n$1/g; It only gets the letters, but I am not sure how to write in the underscore. Any attemps I have made on adding the _ get the wrong results

RE: Regular Expression

2002-02-21 Thread John Edwards
wrong on that. ;) For more on regexes: http://www.google.com/search?sourceid=navclient&q=perl+regular+expressions ;) HTH John -Original Message- From: Lilian Alvarenga Caravela Godoy [mailto:[EMAIL PROTECTED]] Sent: 21 February 2002 14:04 To: '[EMAIL PROTECTED]' Subject: Regu

RES: Regular Expression

2002-02-21 Thread Lilian Alvarenga Caravela Godoy
John Thank you very much for the explanation and for the links. Lilian. -Mensagem original- De: John Edwards [mailto:[EMAIL PROTECTED]] Enviada em: quinta-feira, 21 de fevereiro de 2002 11:11 Para: 'Lilian Alvarenga Caravela Godoy'; '[EMAIL PROTECTED]' Assunto: RE

RE: Regular Expression

2002-02-21 Thread Mark Anderson
$req =~ s/([^\n]{72,72})\n([^\n]{1,71})\n([^\n]{1,71})$/$1\n$2$3/ > # This regex appears to do nothing. It's looking for three matches, then > replacing them with the matches found. It's like saying look for all > instances of "one two three" in the string and replace them with "one two > three"

RES: Regular Expression

2002-02-21 Thread Lilian Alvarenga Caravela Godoy
Para: John Edwards; 'Lilian Alvarenga Caravela Godoy'; [EMAIL PROTECTED] Assunto: RE: Regular Expression $req =~ s/([^\n]{72,72})\n([^\n]{1,71})\n([^\n]{1,71})$/$1\n$2$3/ > # This regex appears to do nothing. It's looking for three matches, then > replacing them with the mat

Re: Regular Expression

2002-02-21 Thread John W. Krahn
Lilian Alvarenga Caravela Godoy wrote: > > Hi everyone > > I am trying to learn Perl looking into some scripts. > > One of them has a regular expression inside. > > First of all, I need to know what two specific lines are doing. The code is > bellow. > > $re

Regular Expression Help

2001-10-19 Thread Gross, Stephan
I'm matching a SQL date like this: $ftime =~ /(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)/; If $ftime is "2001-05-13 11:53:00", then $1 is "2001", $2 is "05", etc. However, I also want to match if the user types in a partial string. For example, if $ftime is "2001-12-18", I want $1, $2 and $3 to

Regular expression help!!

2001-10-25 Thread Woz
Hi, I'm relatively new to the wonders of Perl programming and I've yet to quite get my head around regular expressions. I'm attempting to generate a search and replace expression that will turn the following string insert_job: DUKS_rtcf_daily_log_purge job_type: c into DUKS_rtcf

regular expression help

2002-01-22 Thread David Samuelsson (PAC)
Hello! if i have this line ROXETTE_PC_SW_R1D08 (locked) and just want to remove the (locked) part from it with an regexp how would that look? i can do: s/(locked)// that leaves the pesky () how can i get rid off those? //Dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

  1   2   3   4   5   6   7   8   9   10   >