Ask a Question related to PERL Beginners, Design and Development.
-
Bastian Angerstein #1
Maybe Stupid RegEx Question
Hi
I have two strings 0x1479ee und 0x1479fe.
The strings a in $var1 and $var2.
if I do:
if ( $var2 =~ /\Q$var1\E/)
It matches.
how can I match an the string and not on each sign?
Bastian Angerstein Guest
-
Stupid Question
For as long as I've been doing Elements, I'm embarassed to ask. I've created an oval shaped image. I want to insert it into a web page as an oval... -
really really stupid question
So I made an animation for my website and I want it to run it ionce n the beginning when people go to the home page. Also, I'd like a little box... -
Stupid C# question Please help!
I'm used to writing my code in VBscript but I have to do this project in C#. I've written some functions on my ASP.Net page and I'm getting an... -
a stupid question
how to check the filetype of remote file because is_dir(), is_file() can't work on remote file thx a lot -
Stupid Question, but need heLp
I can't insert a background into my fLash form, how do I do it? -
James Edward Gray II #2
Re: Maybe Stupid RegEx Question
On Feb 12, 2004, at 7:34 AM, Bastian Angerstein wrote:
Hello.>
> Hi
You sure about that?> I have two strings 0x1479ee und 0x1479fe.
>
> The strings a in $var1 and $var2.
>
> if I do:
> if ( $var2 =~ /\Q$var1\E/)
>
> It matches.
#!/usr/bin/perl
my($var1, $var2) = ("0x1479ee", "0x1479fe");
if ($var2 =~ /\Q$var1\E/) { print "They matched.\n"; }
else { print "They didn't match.\n"; }
__END__
The above gives me "They didn't match." as expected.
The obvious answer is that they can't. Because of that, those> how can I match an the string and not on each sign?
variables probably don't contain what you think they contain.
Hope that helps.
James
James Edward Gray II Guest
-
Alan Perry #3
Re: Maybe Stupid RegEx Question
Bastian Angerstein wrote:
As someone else pointed out, I am surprised that you got a match...> Hi
>
> I have two strings 0x1479ee und 0x1479fe.
>
> The strings a in $var1 and $var2.
>
> if I do:
> if ( $var2 =~ /\Q$var1\E/)
>
> It matches.
>
> how can I match an the string and not on each sign?
Just out of curiosity though, why not do this:
if ( $var2 eq $var1 )
Wouldn't that achieve what you want?
Alan
Alan Perry Guest



Reply With Quote

