https://github.com/izarif/tssplit-lua
Lua implementation of tssplit python package
https://github.com/izarif/tssplit-lua
escape-sequences lua quotes split string-manipulation trim
Last synced: 4 months ago
JSON representation
Lua implementation of tssplit python package
- Host: GitHub
- URL: https://github.com/izarif/tssplit-lua
- Owner: izarif
- License: bsd-3-clause
- Created: 2025-01-08T15:20:12.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-01-16T15:41:52.000Z (9 months ago)
- Last Synced: 2025-01-25T12:11:58.468Z (9 months ago)
- Topics: escape-sequences, lua, quotes, split, string-manipulation, trim
- Language: Lua
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trivial split for Lua
Lua implementation of [tssplit](https://github.com/mezantrop/tssplit/) python package
## Usage
```lua
local ts = require("tssplit")ts.split('--:--;--,--"--/--"--\'--:--\'--/"--^--',
{quote="\"'", delimiter=":;,", escape="/^", trim=""})--> {'--', '--', '--', '----/------:----"----'}
ts.split('--:--;--,--"--/--"--\'--:--\'--/"--^--',
{quote="\"'", delimiter=":;,", escape="/^", trim="", quoteKeep=true})--> {'--', '--', '--', '--"--/--"--\'--:--\'--"----'}
ts.split('--:--;--,--"--/--"--\'--:--\'--# Ignore this',
{quote="\"'", delimiter=":;,", escape="/^", trim="", quoteKeep=true, remark="#"})--> {'--', '--', '--', '--"--/--"--\'--:--\'--'}
```