Reputation: 33
after trying and reading Lua's doc on patterns, I couldn't figure it out.
I am using an OBS plugin to activate a source on text document change, and the plugin uses Lua pattern matching. I would like to trigger the source whenver the document is EMPTY and only empty. How can I go about doing this?
Example, using the non-empty pattern match:
Thank you for any help!
Upvotes: 2
Views: 753
Reputation: 626738
Pattern matching an empty string is
^$
where
^
- matches the start of string position$
- matches the end of string position.That is, start and end of string positions must be the same position in the string.
Upvotes: 1