Re: [code] Matching new lines

From: Mitchell <>
Date: Tue, 26 May 2020 12:30:01 -0400 (EDT)

Hi James,

On Tue, 26 May 2020, James Reynolds wrote:

> The documentation says: "Note that Textadept’s editing component, Scintilla, does not allow for matching newline characters (\r and \n). Use Lua scripts and Lua patterns instead."
> I'm familiar with grep but I'm new to Lua Patterns. I've looked at them and they look like grep but I am unsure what Lua Pattern I would use to match \r or \n. And does this mean I would have to write a Lua script to match newlines or can I use Lua Patterns in the find and replace fields?

You would write a Lua script that fetches text (e.g. via `buffer:get_text()`) and searches within it for newlines (e.g. `text:find('something\r?\n')`). The wiki has a module that allows you to toggle between regex and Lua patterns for the Find & Replace pane, but you cannot use Lua patterns in that pane by default.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Tue 26 May 2020 - 12:30:01 EDT

This archive was generated by hypermail 2.2.0 : Wed 27 May 2020 - 06:54:27 EDT