LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Kate - Regular Expression Replace and Other Features? (https://www.linuxquestions.org/questions/linux-software-2/kate-regular-expression-replace-and-other-features-273801/)

apachedude 01-04-2005 01:49 PM

Kate - Regular Expression Replace and Other Features?
 
My favorite text editor, UltraEdit, unfortunately only runs on Windows. I have found Kate to be a suitable replacement, but it is not nearly as powerful as UltraEdit.

The first feature I miss is regular expression replace--I have a feeling that the feature exists, it's just that I haven't been using Kate correctly. As you probably know, Kate offers regular expression find. But it doesn't seem to offer regular expression replace. For example, if I check the Regular Expression option, with
Quote:

Find: <br>
Replace: \n
I just get the literal \n, as though I had typed in \\n instead (\\ being the escape sequence for \). Similarly, other escape sequences don't work.

In a similar vein, regular expressions--at least its implementation in UltraEdit would allow me to do something like...
Quote:

Find: ([a-z]+) ([a-z]+)
Replace: \2 \1
This would switch foo bar with bar foo.

UltraEdit, however, is limited in its regular expression capacity. It does not allow for quantifiers such as {3,}--a feature I hope to eventually see in Kate some day.

The second feature that I miss are column edit--by which you can select an entire column of a text file, instead of a row. It allows you to, for instance, add the <li> tag in front of all items of a text list if you were to convert it to html. Or to add tabs in front of a series of selected lines to clean up your code.

The final feature is find and replace capacity for all open files. Often times, I might have, for instance, a bunch of HTML files whose HTML tags I want to strip. I just do a series of find and replace to remove the HTML tags, the comments, and the escape sequences and enter the proper white space for <p> and <br>. Granted, there are other ways to convert HTML to text, but find and replace all open files comes in handy for other reasons as well.


All times are GMT -5. The time now is 03:27 PM.