Burrito
Burrito

Reputation: 33

Regex pattern search in TextPad fails, works in Visual Studio

I'm trying to use TextPad to search for a regular expression in several files. I have a simple pattern but it doesn't work in TextPad. It works fine in Visual Studio.

Anyone have any ideas?

I'm searching for:

hosted.mysite.com or host.mysite.com

using the pattern:

(hosted|host)\.mysite\.com

Upvotes: 3

Views: 2504

Answers (5)

Yordan Georgiev
Yordan Georgiev

Reputation: 5440

Textpad's POSIX regexes are good, but even better results could be achieved by installing the Win GNU util grep and adding a cmd /c "Prompt for parameters " , "Capture output" command: thus you could have full Find in files with even Perl regexes: grep -nhPr "CoolRegexToSearchWith" C:\MyDir\ToSearchRecursivly

Upvotes: 1

Seb
Seb

Reputation: 25147

In Textpad you need to escape some characters, such as parenthesis and pipes.

In your case, what you need is this:

\(hosted\|host\)\.mysite\.com

Note: you need to escape dots as well.

Upvotes: 1

BobBrez
BobBrez

Reputation: 723

Use something like this

\(hosted\|host\).mysite.com

Upvotes: 5

Geo
Geo

Reputation: 96927

Not every text editor uses the same regex/conventions. A regex you may get to work in Visual Studio won't necessarily work in Eclipse, Netbeans, or some other IDE or text editor.

Upvotes: 2

akf
akf

Reputation: 39495

try this:

 host\(ed\)?\.mysite\.com

Upvotes: 3

Related Questions