Re: extracting a string

2003-07-29 Thread Rob Dixon
"Jeff 'Japhy' Pinyan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Jul 28, Tara Calishain said: > > >At 01:22 PM 7/28/2003, you wrote: > > > >>> What perl function can i use to extract a > >>> sub-string from a string. > >> > >>$string = 'myfile.txt'; > >> > >>$string =~ m

RE: extracting a string

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Tara Calishain said: >At 01:22 PM 7/28/2003, you wrote: > >>> What perl function can i use to extract a >>> sub-string from a string. >> >>$string = 'myfile.txt'; >> >>$string =~ m/^(\w+)\.txt$/; > >When I saw this question I immediately thought > >my $string = "myfile.txt"; >my $s

RE: extracting a string

2003-07-28 Thread Tara Calishain
At 01:22 PM 7/28/2003, you wrote: >> Hi there, >> >> What perl function can i use to extract a >> sub-string from a string. >> >> > >$string = 'myfile.txt'; > >$string =~ m/^(\w+)\.txt$/; > >print $1; When I saw this question I immediately thought my $string = "myfile.txt"; my $subst

RE: extracting a string

2003-07-28 Thread Joe Echavarria
Thanks. --- Dan Muey <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > What perl function can i use to extract a > > sub-string from a string. > > > > > > $string = 'myfile.txt'; > > $string =~ m/^(\w+)\.txt$/; > > print $1; > > HTH > > DMuey > > > I have "myfile.txt", and i

RE: extracting a string

2003-07-28 Thread Dan Muey
> Hi there, > > What perl function can i use to extract a > sub-string from a string. > > $string = 'myfile.txt'; $string =~ m/^(\w+)\.txt$/; print $1; HTH DMuey > I have "myfile.txt", and i only want to print > "myfile" to the screen , how can i do it ? > > >Thanks.

Re: extracting a string

2003-07-28 Thread Casey West
It was Monday, July 28, 2003 when Joe Echavarria took the soap box, saying: : : : Hi there, : : What perl function can i use to extract a sub-string from a : string. : : : I have "myfile.txt", and i only want to print "myfile" to the : screen , how can i do it ? If you woul

Re: extracting a string from between parens

2002-06-26 Thread David T-G
Shishir, et al -- ...and then Shishir K. Singh said... % ... % >Again, the most straightforward solution is: % % > ($out) = $in =~ /\((.*?)\)/; % % You are right ...this will be the the most simple sol..in case nothing needs to be done to $out...but in case % some thing needs to be done on

Re: extracting a string from between parens

2002-06-26 Thread drieux
On Wednesday, June 26, 2002, at 08:26 , todd shifflett wrote: > I have this situation: > $in = "02 Jul 5.00 (YHZ GA-E)" > > I want: > $out = "YHZGA-E" you have a two stage problem - a) get the stuff between the () b) remove the white space if ($in =~ /\

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
> > On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote: > > >> $out = $1 if ($in =~ /\((.*?)\)/); > > Nope..won't work..I take it back!! > > > > >looks ok to me. except it adds extra strokes to previous answer. > >what do you think is wrong with it? > > It will work fine as far

RE: extracting a string from between parens

2002-06-26 Thread Bob Showalter
> -Original Message- > From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 26, 2002 12:26 PM > To: bob ackerman; [EMAIL PROTECTED] > Subject: RE: extracting a string from between parens > > > > On Wednesday, June 26, 2002, at 08:48

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote: >> $out = $1 if ($in =~ /\((.*?)\)/); > Nope..won't work..I take it back!! > >looks ok to me. except it adds extra strokes to previous answer. >what do you think is wrong with it? It will work fine as far as the regex is concer

RE: extracting a string from between parens

2002-06-26 Thread LoBue, Mark
> -Original Message- > From: bob ackerman [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 26, 2002 9:07 AM > To: [EMAIL PROTECTED] > Subject: Re: extracting a string from between parens > > > > On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh

Re: extracting a string from between parens

2002-06-26 Thread bob ackerman
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote: >> $out = $1 if ($in =~ /\((.*?)\)/); > Nope..won't work..I take it back!! > looks ok to me. except it adds extra strokes to previous answer. what do you think is wrong with it?

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
> > >I have this situation: > > $in = "02 Jul 5.00 (YHZ GA-E)" > > > >I want: > > $out = "YHZGA-E" > > > >How do I extract the information between the ()s ? > >Other than the parens all other characters are likely to change. > > Perhaps > $in =~ /\((.*?)\)/; > $out = $1; >This is a

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
> -Original Message- > From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 26, 2002 11:30 AM > To: todd shifflett; [EMAIL PROTECTED] > Subject: RE: extracting a string from between parens > > > >I have this situation: > >

RE: extracting a string from between parens

2002-06-26 Thread Bob Showalter
> -Original Message- > From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 26, 2002 11:30 AM > To: todd shifflett; [EMAIL PROTECTED] > Subject: RE: extracting a string from between parens > > > >I have this situation: > >