Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grep e Expressões regulares
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Portuguese
View previous topic :: View next topic  
Author Message
bbranta
n00b
n00b


Joined: 21 Jun 2006
Posts: 2

PostPosted: Wed Jun 21, 2006 12:49 pm    Post subject: Grep e Expressões regulares Reply with quote

Pessoal,
Gostaria de saber como faço uma expressão regular que case tudo entre dois caracteres. Em todos os manuais indicam que o ponto faria isso, contudo ele não casa com marca de nova linha, e até ela eu gostaria que fosse incluida.
O comando seria algo como:
grep -o '#.*#' commitlog2

Gostaria tambem que esses separadores que eu estou usando (#) nao aparecessem no resultado, eh possivel?
Obrigado,
Back to top
View user's profile Send private message
RoadRunner
Bodhisattva
Bodhisattva


Joined: 12 Jun 2002
Posts: 490
Location: Coimbra, Portugal

PostPosted: Thu Jun 22, 2006 3:09 am    Post subject: Reply with quote

Não estou bem a perceber o que queres fazer, que tal dares um exemplo da expressão que queres encontrar?
Back to top
View user's profile Send private message
bbranta
n00b
n00b


Joined: 21 Jun 2006
Posts: 2

PostPosted: Thu Jun 22, 2006 5:14 am    Post subject: Reply with quote

Por exemplo, dada a expressão que eu falei: grep -o '#.*#' commitlog2

Queria que tendo o conteúdo do arquivo:
The Gentoo Store has updated its selection of #clothing and schwag. The main addition is the new line-up of women's clothing sporting the Gentoo logo. This was done after requests were# made from a few forums users, as well as to help with the proposed Gentoo Women project. Also, some new stickers and other items have been added to the Schwag section of the store, including a nice Gentoo wall clock. Updated CD media will be available after 2006.1 is released.

Gostaria que após o comando fosse retornado:
clothing and schwag. The main addition is the new line-up of women's clothing sporting the Gentoo logo. This was done after requests were


Contudo o .* não aceita quebras de linha...

Obrigado!
Back to top
View user's profile Send private message
MetalGod
Bodhisattva
Bodhisattva


Joined: 10 Mar 2003
Posts: 816
Location: Portugal

PostPosted: Thu Jun 22, 2006 11:21 am    Post subject: Reply with quote

se isso tiver num ficheiro secalhar era mais facil usares o sed. 8)
_________________
ex: Gentoo Linux Developer: amd64 media-optical sound gnome
ex: Portuguese Moderator
------------------------------------------------------------------------------
God Doesn't Play Dice
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portuguese All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum