From: "Artem K. Jouravsky" <ujo@zuzusoft.com>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] Re: [mdk-re] Обратно perl
Date: Fri Jul 20 13:00:11 2001
Message-ID: <20010720131847.1f60c0f8.ujo@zuzusoft.com> (raw)
In-Reply-To: <3B57F32F.775AB105@zmail.ru>
Здравствуйте, cornet <cornet@zmail.ru>!
От Fri, 20 Jul 2001 13:00:31 +0400 вы писали на тему Re: [mdk-re] Re: [mdk-re] Обратно perl:
> Sergey Degtyaryov wrote:
> >
> > Доброго времени суток, cornet,
> >
> > 20.07.2001 в 12:38 Вы сказали буквально следующее:
> >
> > c> Я не знал про это свойство
> if(/переменная_содержащая_шаблон/)
> > c> искать этот шаблон в $_ как подстроку.
> >
> > Дело в том, что
> >
> > if( $_=~/^.*$tpl.*$/)
> > {
> > print "Ok\n";
> > }
> >
> > (Ваш код)
> > работает точно так же.
> > Просто ^.* и .*$ - лишнее, строка же обязательно начинается и
> > обязательно заканчивается =)
>
> В том то и дело, что нет! В регулярных выражениях (по крайней
> мере в perl) символ $ обозначает конец строки, а не начало
> имени
> переменной. Такой код не работает - уже пробовал - он всегда
> дает
> истину вне зависимости от содержимого $_ лишь бы она была
> определена.
> Эффектиивной частью такого кода остается ^.*$ то есть любые
> символы любое число раз, а дальше $ уже пофигу, строка то уже
> кончилась...
[ujo@ninth ujo]$ perl -e '$tt = "babuby";$_ = "sahfdhsagfbabubydskfdsjkgf";print /$tt/,"\n"'
1
[ujo@ninth ujo]$ perl -e '$tt = "babuby";$_ = "sahfdhsagfbabbydskfdsjkgf";print /$tt/,"\n"'
[ujo@ninth ujo]$
А вот это как? ;)
------
Best wishes,
+----------------------+--------------------------+
| ."-. | Work: +7-(095)-229-4278 |
| /X | _o.----. _ | ICQ: 103399444 |
|/\_ \/ / __ \_// ) | Artem K. Jouravsky |
|\__)-/_/\_____)____/ | http://www.ifirst.ru/ |
+----------------------+--------------------------+
next prev parent reply other threads:[~2001-07-20 13:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-20 11:35 cornet
2001-07-20 11:55 ` [mdk-re] " Sergey Degtyaryov
2001-07-20 12:23 ` cornet
2001-07-20 12:33 ` Sergey Degtyaryov
2001-07-20 12:46 ` cornet
2001-07-20 12:59 ` Sergey Degtyaryov
2001-07-20 13:00 ` Artem K. Jouravsky [this message]
2001-07-20 13:11 ` cornet
2001-07-21 0:28 ` [mdk-re] " Mikhail Zabaluev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010720131847.1f60c0f8.ujo@zuzusoft.com \
--to=ujo@zuzusoft.com \
--cc=mandrake-russian@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git