2

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?

Splendor
  • 1,386
  • 6
  • 28
  • 62
  • Haven't used it in years,but assuming you turned on the regex search option maybe textpad wants you to write the parens `(summer|winter)` or i've seen this in some apps `\(summer|winter\)` which is non-obvious cause you woud think you don't want to escape but it requires you to. – gillyspy May 03 '13 at 18:59
  • @gillyspy No luck. I get zero results with those too. – Splendor May 03 '13 at 19:08
  • their online faq says that they fixed "Reject "|" as a regular expression" in 7.0.7 – gillyspy May 04 '13 at 00:46
  • @gillyspy Thanks! I'm using an older version so that must be the issue. If you add this as an answer I'll accept it. – Splendor May 06 '13 at 14:14

5 Answers5

4

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

gillyspy
  • 1,578
  • 8
  • 14
1

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]
rayryeng
  • 102,964
  • 22
  • 184
  • 193
Tidy Jim
  • 11
  • 1
1

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

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

Matheus Cuba
  • 2,068
  • 1
  • 20
  • 31
0

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

summer\|winter

-1

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

Steven Liao
  • 3,577
  • 3
  • 19
  • 25