Need to Search with Mix of CR and LF and CRLF

Tool for Search and Replace across multiple files.
Post Reply
User avatar
bellaonline
Posts: 4
Joined: Thu Apr 16, 2015 3:47 am

Need to Search with Mix of CR and LF and CRLF

Post by bellaonline »

I've had my HTML files for decades now and have edited them on a variety of systems. Then can have layouts like:

Text1[LF]
Text2[CRLF]
Text3[LF]

and so on. If I need to search on a three-line set in order to make sure it's unique, because a single line alone might be found elsewhere in the page's HTML, I can't seem to do it. I can only set the search to work with one specific line ending which means it fails the search.

Any thoughts or suggestions?

I do have the paid version of TextCrawler. In general I adore this program and use it ALL the time.

Thanks!
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

Re: Need to Search with Mix of CR and LF and CRLF

Post by DigitalVolcano »

You can use a regular expression to match mixed line endings like so-

Code: Select all

(\n|\r\n?)
Example - match consecutive lines containing a, b and c.

Code: Select all

a(\n|\r\n?)b(\n|\r\n?)c
Post Reply