Page 1 of 1

kate - search/replace using regex

Posted: Sun Apr 19, 2020 1:36 pm
by sadhu
I can't seem to find any control that enables entering regex expressions.

My file has 216 lines containing text like this <p><span class="parno">218</span>
But when I try to search for <p><span class="parno">([0-9]*?)<\/span> I get no hits.
My replacement string would be <p>[\1]

Is there some plugin required?

I'm running kate Version 17.12.3


Thanks
-Sadhu

Re: kate - search/replace using regex

Posted: Sun Apr 19, 2020 6:59 pm
by Kadaitcha Man
sadhu wrote:
Sun Apr 19, 2020 1:36 pm
... I get no hits.
I typed your subject line into a search engine and got 131,000 hits.

The second link was for the official documentation. The first link was a tutorial.

Why you couldn't have done that is beyond me.

Screenshot_20200420_085529.jpg

https://www.msbfr.net/item/250-find-and ... ex-in-kate

https://docs.kde.org/stable5/en/applica ... place.html

Re: kate - search/replace using regex

Posted: Mon Apr 20, 2020 12:41 am
by sadhu
No hits that worked, that had all of the keywords, I mean. Most were for regex...

But never mind.

This is what my kate screen looks like. Please tell me how I engage regex search.

Re: kate - search/replace using regex

Posted: Mon Apr 20, 2020 1:04 am
by Kadaitcha Man
sadhu wrote:
Mon Apr 20, 2020 12:41 am
Please tell me how I engage regex search.
I gave you the exact search term, and I gave you two links. You have given no indication that you used the information already provided to you. You'll have to wait for someone to come and spoon-feed you, I'm sorry.

Re: kate - search/replace using regex

Posted: Mon Apr 20, 2020 1:22 am
by sadhu
I completely removed kate, purged the unnecessary files, and reinstalled. No luck

Then I installed kate in an old copy of LM 18.3. In this version (15.12.3) there is a regex search.
See the attachment.

Notice that "<Ctrl>+<Shift>+u101<space>" STILL doesn't produce the macron-a: ā

Sadhu


BT

Re: kate - search/replace using regex

Posted: Mon Apr 20, 2020 2:50 am
by sadhu
Kadaitcha Man wrote:
Mon Apr 20, 2020 1:04 am
[I gave you the exact search term, and I gave you two links. You have given no indication that you used the information already provided to you. You'll have to wait for someone to come and spoon-feed you, I'm sorry.
Even though your answer is a bit on the snotty side, let me quote the very first result/link (which I had checked before)
  • Regular Expression

    If selected, the search string is interpreted as a regular expression. The Add menuitem at the bottom of the context menu of the text boxes will be enabled and allows you to add regular expression items to the search pattern from a predefined list.

    See Regular Expressions for more on these.
So, looking at the screen caps above, where the h is the selection for "regular expression lm 19.3?" Note that I have a regex selection in my newly-installed kate in LM18.3, but not 19.2

I suppose this lockdown is making all of us a bit testy.

-Sadhu

Re: kate - search/replace using regex

Posted: Mon Apr 20, 2020 11:04 am
by sadhu
Sigh. I completely reinstalled lm19.3, and have added no new applications except kate.

The new version of kate (Kate version 17.12.13, libraries KDE Frameworks 5.44.0, Qt 5.9.5 (built against 5.9.5), The xcb windowing system) now shows the regex button.

note that the version I got using synaptic was version 17.12.3! WHY the different versions??

Still doesn't allow inputting Unicode via Ctrl-Shift-u, though.

So now I'll start installing my standard set of applications, and see if somethning affects kate.

BTW I seem to recall once before I was doing some regex stuff with kate, sed, and komodo, and something happened, the screen locked up or something, or I had to cycle power because i got everything stopped working (this happens to me just about once a day), and it was after that when I discovered kate no longer did regex.

-sadhu