Skip to content

Add multiline regex option for code searching.#2270

Merged
colinator27 merged 2 commits intoUnderminersTeam:masterfrom
zivmaor:SearchMultilineRegex
Dec 18, 2025
Merged

Add multiline regex option for code searching.#2270
colinator27 merged 2 commits intoUnderminersTeam:masterfrom
zivmaor:SearchMultilineRegex

Conversation

@zivmaor
Copy link
Copy Markdown
Contributor

@zivmaor zivmaor commented Nov 9, 2025

Implements #2144. Adds new "Multiline regex" checkbox to Search in code UI. When the box is checked while doing a regex search, the search is treated as a multiline regular expression (^ and $ match line start and end instead of string start and end). The option is only visible when doing a regex search.

Description

While the Regex search box is unticked, the UI remains the same as before this change:
image
When Regex search is selected, the new Multiline regex box appears. It's default value is false, which was the behaviour of the regex search before the change:
image

As an example I search for the third line of "gml_Script_attention_hackerz_no_2" from Undertale to show that it only appears while using a multiline regex:
image
image

Caveats

There should be no caveats with the changes in this PR. I have tested multiline regex and it works correctly with and without Case sensitive. Any user who doesn't use regex search is completely uneffected, and those who do use regex search are uneffected unless they tick the new box.

Notes

Issue #2144 Requested multiline regexes in both Search in code (Ctrl+Shift+F) and the code editor (Ctrl+F), but this PR only adds them to Search in code. I looked at how searching in the code editor works and it is part of avalonEdit and not UTMT. It is already in multiline mode (see https://github.com/icsharpcode/AvalonEdit/blob/862415d51eddc9eac93f462dbc522ffbf929cd52/ICSharpCode.AvalonEdit/Search/SearchStrategyFactory.cs#L37) with no easy way to turn off multiline mode.
Closes #2144.

Implements UnderminersTeam#2144. Adds new "Multiline regex" checkbox to Search in code
UI. When the box is checked while doing a regex search, the search is
treated as a multiline regular expression (^ and $ match line start and
end instead of string start and end). The option is only visible when
doing a regex search.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 9, 2025

@zivmaor zivmaor marked this pull request as draft November 9, 2025 17:58
@zivmaor zivmaor marked this pull request as ready for review November 9, 2025 18:22
Copy link
Copy Markdown
Member

@colinator27 colinator27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@colinator27 colinator27 merged commit e565502 into UnderminersTeam:master Dec 18, 2025
5 checks passed
@zivmaor zivmaor deleted the SearchMultilineRegex branch January 8, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Multiline" option for code searching.

2 participants