Re: Замена "вариативного" фрагмента строки.
- To: debian-russian@lists.debian.org
- Subject: Re: Замена "вариативного" фрагмента строки.
- From: Sergey Korobitsin <undertaker@arta.kz>
- Date: Mon, 31 May 2010 21:27:37 +0600
- Message-id: <20100531152737.GH25129@undertaker.arta.local>
- In-reply-to: <20100531151815.GV5608@wrars-comp.wrarsdomain>
- References: <hu0in1$sgh$1@dough.gmane.org> <20100531151339.GG25129@undertaker.arta.local> <20100531151815.GV5608@wrars-comp.wrarsdomain>
Andrey Rahmatullin ☫ → To debian-russian@lists.debian.org @ Mon, May 31, 2010 21:18 +0600
> On Mon, May 31, 2010 at 09:13:39PM +0600, Sergey Korobitsin wrote:
> > > Как можно заменить все фрагменты, которые начинаются, например, на
> > > "background-color:" и заканчиваются на ";" , на "xxx" ?
> > cat file | sed -e '{ s/background-color:.*;/xxx/g }'
> Думаю, таки .*? (если в седе это делается как везде).
Из grep(1):
Repetition
A regular expression may be followed by one of several
repetition operators:
? The preceding item is optional and matched at most once.
* The preceding item will be matched zero or more times.
Это, получается, какой-то ограничитель "жадности" звёздочки?
--
Bright regards, Sergey Korobitsin | http://the-brights.net/ --
Arta Software, http://arta.kz/ | illuminating and elevating
xmpp:undertaker@jabber.arta.kz | the naturalistic worldview
--
Шрифты в грызлись в нежные глазные яблоки и со смаком захрустели зрачками.
-- wfrr @ linux.org.ru
Reply to: