Add multiline regex option for code searching.#2270
Merged
colinator27 merged 2 commits intoUnderminersTeam:masterfrom Dec 18, 2025
Merged
Add multiline regex option for code searching.#2270colinator27 merged 2 commits intoUnderminersTeam:masterfrom
colinator27 merged 2 commits intoUnderminersTeam:masterfrom
Conversation
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.
|
Download the artifacts for this pull request here: GUI:
CLI: |
colinator27
approved these changes
Dec 18, 2025
Member
colinator27
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:


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:
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:


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.