Mais uma extensão para o gEdit

Oct
25

Olá a todos!

Essa semana precisei fazer uma substituição de termos à partir de uma expressão regular, e descobri que o gEdit(na versão 2.15.9 que é a que tenho no trabalho) não suporta busca por expressões regulares. Então fui ao pai de todos os desesperados, o Google, e achei um cara que tinha feito metade do caminho: uma extensão que pesquisa com expressão regular, mas que não faz o replace.

Então, o que eu fiz? Mexi nela e coloquei a opção de subsituição do termo da expressão regular :-)

A extensão ainda pode ser melhorada com, por exemplo, uma opção de substituir todas as ocorrências(atualmente ele só faz uma por vez).

Abaixo está o arquivo zip, e basta você descompactar em ~/.gnome2/gedit/plugins

[UPDATE] Graças ao software livre, aqui tem uma versão melhorada, feita à partir da minha versão.

AttachmentSize
regexsearch-replace.zip4.8 KB

4 comments

Scorpfromhell (not verified)

Great plugin. I was in search of a regex replace plugin for a long time & finally found yours from the comment you left at http://danieldandrada.blogspot.com/2006/05/regex-searches-in-gedit.html

I guess it can be extended if you include named capture, this is the most interesting replace option for most coders I believe.

May be you could use re.subn() function instead of the replace_text function you have defined in the plugin? More info on subn is available here: http://docs.python.org/dev/howto/regex.html

rafael

Hi,

Thanks for your comment.

I'm a little busy these days, so I can't work on it for now. But this plugin is free open source software, feel free to expand it.

If you do it, please let me know, I want it too. :-)

Cheers

Adam Victor Brandizzi (not verified)

Olá, Rafael!

Encontrei este plugin e o link para sua versão no blog do Daniel: http://danieldandrada.blogspot.com/2006/05/regex-searches-in-gedit.html. Ajudou-me bastante!

Por outro lado, senti falta de algumas funcionalidades, então adicionei-as. Para facilitar o acesso e a contribuição, criei um projeto no BitBucket para compartilhar a versão: http://bitbucket.org/brandizzi/gedit-re-search/

Creio que gostaria de saber disso.

Obrigado, e até mais!

rafael

Oi Adam,

Parabéns pelo trabalho. A intenção é essa mesmo. Valeu por me avisar, já vou atualizar.

Abraços

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <small> <sup> <sub> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <img> <br> <br /> <p> <div> <span> <b> <i>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.