Andrey Rahmatullin ☫ → To [email protected] @ 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:[email protected]  | the naturalistic worldview

--
Шрифты в грызлись в нежные глазные яблоки и со смаком захрустели зрачками.
        -- wfrr @ linux.org.ru


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Ответить