Splendor
Splendor

Reputation: 1396

TextPad "find in files" not matching on simple OR regex

I've tried searching files for either/or word scenarios and they always fail to find any results in TextPad.

An example is trying to find something like summer|winter where I want to return any files that contain either the word "summer" or the word "winter".

enter image description here

This regex works fine in other programs like Notepad++. Why doesn't it work in TextPad?

Upvotes: 2

Views: 7557

Answers (5)

Juan Peñaherrera
Juan Peñaherrera

Reputation: 55

On older versions It works with: \(summer\|winter\),

Escape (alt+92 backslash) before every paren and "or" carácter.

Upvotes: 1

Tidy Jim
Tidy Jim

Reputation: 11

Textpad seems to use slightly unusual syntax for regex 'finds'. Read the TextPad help file for the details. Here is an example for finding a IPv4 number. It works with textpad v4.7.3 'Find' and 'Find in files'

[^0-9][0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}[^0-9]

Upvotes: 1

Racer Online
Racer Online

Reputation: 1

Using Textpad 6.x, I have to escape the or operator and it works:

summer\|winter

Upvotes: 0

gillyspy
gillyspy

Reputation: 1598

Textpad.com online release notes says that they fixed a bug in 7.0.7 related to this where they:

Reject "|" as a regular expression

Upvotes: 4

Steven Liao
Steven Liao

Reputation: 3787

Try (summer)|(winter): it could be reading it as summe(r|w)inter.

Upvotes: -1

Related Questions