SciTE Find and Replace features

The popular SciTE-based AutoHotkey Script Editor
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

SciTE Find and Replace features

28 Feb 2016, 15:56

I LOVE using SciTE but had some confusion on find / replace functionality when I first used it. In particular when to use Regular Expression option verse Transform Backslash expressions.

I also wanted to document the cool feature of blocking multiple lines / typing over multiple lines. This comes in very handy more often that I would have thought!

Also, I changed my default setting for RegEx to use POSIX. Otherwise you need to escape the parens (which I find incredibly hard to read)
If you want to do the same- you can edit your user.properties file with the following two lines

Code: Select all

#### Changing Replace to posix regular expression mode so do not have to escape parens
find.replace.regexp.posix=1
Anyway, if none of this makes sense (but sounds interesting) I have the Find and Replace Scite video here.


And here are a couple of helpful pages with:
SciTE documentation
SciTE RegEx documentation

Here are some useful POSIX terms which are more readable: [:xxx:] were xxx is one of the following words:
NAME DESCRIPTION
alnum letters and digits
alpha letters
digit decimal digits (like \d)
lower lower case letters
punct printing characters, excluding letters and digits
space white space
upper upper case letters
word "word" characters (like \w)
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
czyt
Posts: 2
Joined: 29 Oct 2015, 22:38

Re: SciTE Find and Replace features

05 May 2016, 02:49

it is really useful for me.
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: SciTE Find and Replace features

05 May 2016, 19:36

Great! I use the above daily... Once you get in good practice it becomes very useful. :)
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
doubledave22
Posts: 343
Joined: 08 Jun 2019, 17:36

Re: SciTE Find and Replace features

23 Feb 2022, 10:24

I've been trying to find this find and replace with regex feature for ages. In the video you magically bring up the find and replace pop out window... I can't seem to find this in my version. When I click about i see I have:

SciTE4AutoHotkey
Version 3.0.06.01 - Based on SciTE 3.5.1

But if I go to the scintilla page: https://www.scintilla.org/SciTE.html I can see there is a 5.2.0 available. Do I need a newer version of scite to do what's in the video? thanks!
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: SciTE Find and Replace features

23 Feb 2022, 13:43

You'll need to edit your SciTEUser.Properties file.

I took a quick look and here is what I have in mine around the find/replace box. You'll have to play with it to figure out what you like/don't like

Code: Select all

#***********Find and replace settings******************* 
#~ Setting save.find cause the "Find what" and "Replace with" to be saved in the session file.
save.find=1
# alternative find window (as strip at bottom of page)
find.use.strip=0
#;***********replace******************* 
# alternative Replace window
replace.use.strip=0
#~ These properties define the initial conditions for find and replace commands. The find.replace.matchcase property turns of the "Match case" option, find.replace.regexp the "Regular expression" option, find.replace.wrap the "Wrap around" option and find.replace.escapes the "Transform backslash expressions" option.
find.replace.matchcase=0
find.replace.regexp=0

#~ Changing  to posix regular expression mode so do not have to escape parens
find.replace.regexp.posix=1

# Set defualts to not be on
find.replace.matchcase=0
find.replace.regexp=0
find.replace.wrap=1
#Transform Backslash expression
find.replace.escapes=1

#~ Enables Replace in Buffers command and Search only in this style checkbox. If enabled, searches can be restricted to a particular style (e.g. strings).
find.replace.advanced=0

# prevents findbox from closing if doesn't find searched text
find.close.on.find=0

# sets Replace to use what is in Find (if populated)
find.replacewith.focus=1

# plays sound if not found-  0 or 1 if want to flash window
warning.notfound=0,B:\Progs\AutoHotkey_L\Audio\inconceivable.wav
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
doubledave22
Posts: 343
Joined: 08 Jun 2019, 17:36

Re: SciTE Find and Replace features

24 Feb 2022, 17:10

:dance: :dance: thanks Joe!! I never would have figured that out on my own
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: SciTE Find and Replace features

27 Feb 2022, 08:34

doubledave22 wrote:
24 Feb 2022, 17:10
:dance: :dance: thanks Joe!! I never would have figured that out on my own
No problem! It's why I shared all this in the first place. It took me hours, upon hours, to figure out! :)

SciTE is amazingly customizable! There are some real great things that you can do that don't come out of the box.
I have a lot of SciTE4AutoHotkey tutorials and resources here.

I no longer use it for developing in AutoHotkey, (I switched to AHK Studio) but there's not a day that goes by where I don't use it for a ton of other things!
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 22 guests