n
>
>
> Thanks for everyone's help.
>
> Sander
>
> -Original Message-
> From: Dan Muey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 1:09 PM
> To: Rob Dixon; [EMAIL PROTECTED]
> Subject: RE: Quick regex prob
>
>
>
>
1:09 PM
To: Rob Dixon; [EMAIL PROTECTED]
Subject: RE: Quick regex prob
> Dan Muey wrote:
> > Hiya, I'm having a brain melt right now :
> >
> > I do this to match one word only.
> > m/^(\w+)$/)
>
> That matches an entire line which is just a string o
> Dan Muey wrote:
> > Hiya, I'm having a brain melt right now :
> >
> > I do this to match one word only.
> > m/^(\w+)$/)
>
> That matches an entire line which is just a string of 'word'
> characters ( A-Z, a-z, 0-9, and underscore ).
>
> > What regex do I need to match multiple , unkown ammou
Dan Muey wrote:
> Hiya, I'm having a brain melt right now :
>
> I do this to match one word only.
> m/^(\w+)$/)
That matches an entire line which is just a string of 'word'
characters ( A-Z, a-z, 0-9, and underscore ).
> What regex do I need to match multiple , unkown ammounts of words?
> Will th
Hiya, I'm having a brain melt right now :
I do this to match one word only.
m/^(\w+)$/)
What regex do I need to match multiple , unkown ammounts of words?
Will this do it? Or is there a better way?
m/^\w[\w*|\s*]\w$/
I know there is but like Isaid my brain stopped for luunch a while ago.
Thank
Zielinski Daniel wrote at Mon, 23 Sep 2002 13:53:54 +0200:
> Got following problem:
>
> Want to substitute roman digits (I...) with arabic(1...):
>
> $corr_line="Vol. I, parte speciale" (example, position of I may
> vary)
> $corr_line=~s/(>| |,|;)I( |,|;|:|\n)/$11$2/;
>
> I think that I have t
On Sep 23, Zielinski Daniel (P) said:
>$corr_line=~s/(>| |,|;)I( |,|;|:|\n)/$11$2/;
Perl sees "$11$2" as two variables -- $11 and $2. You want "${1}1$2",
which makes Perl separate the $1 from the 1.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia bro
Hi!
Got following problem:
Want to substitute roman digits (I...) with arabic(1...):
$corr_line="Vol. I, parte speciale" (example, position of I may
vary)
$corr_line=~s/(>| |,|;)I( |,|;|:|\n)/$11$2/;
I think that I have to interpolate the variables but don't know how.
Can anybody give me a hin
I just keep learning. This list is making learning much easier.
Thanks to Dan and Jason,
Patrick
> you need the global modifier .. what you're trying to do is do the current
> match globally throughout the whole string (not zero or more)
>
> $mystring =~ s/\'/\\'/g;
J. Patrick Lanigan writes ..
>> I was using:
>>
>> $mystring =~ s/\'/\\'/;
>>
>> ...to replace ' with \' in $mystring. It was working find I
>> thought, until I
>> encountered a string with multiple apostrophies. How do I replace
>> 0 or more?
>>
>> Ex:
>>
>> "No More 'I Love You's'"
>
Opps, I forgot to change the subject. I think I need to get outside and get
some fresh air.
> I was using:
>
> $mystring =~ s/\'/\\'/;
>
> ...to replace ' with \' in $mystring. It was working find I
> thought, until I
> encountered a string with multiple apostrophies. How do I replace
> 0 or
11 matches
Mail list logo