I'm trying to convert this regex pattern to lpeg: { *(?<!-)[, ](?!-) *} It's meant to be used as a splitting pattern, turning 2.5 2.6/2.5, 2.6 to 2 ...
I'm trying to convert this regex pattern to lpeg: { *(?<!-)[, ](?!-) *} It's meant to be used as a splitting pattern, turning 2.5 2.6/2.5, 2.6 to 2 ...
R"09"^0 * S"13579" does not work because R"09"^0 will consume all digits and S"13579" will have nothing to match. ...
This was spun off from the comments on this question. As I understand, in the PEG grammar, it's possible to implement a non-greedy search by writing ...
I would like to understand how I could lpeg to replace strings if they are NOT between a certain start and end delimiter. Below is an example, where I ...
For example, I pass an expression string and a context table and it return a boolean value whether it was true/false. Can I do this using LPEG? Somet ...
My environment: Lua 5.1 Absolutely no libraries with a native component (like a C .so/.dll) can be used I can run any arbitrary pure Lua 5.1 c ...
Is there a way to create an LPeg pattern that always fails to match anything? I'm not talking about matching the empty string, I'm talking about a pat ...
Available in my Lua 5.1 environment are obviously the default Lua pattern matching, but also a reasonably recent version of PCRE and LPEG. I don't hon ...
I'm trying to write an LPeg pattern to match strings which: begin with a letter thereafter contain alphanumeric characters does not contain tw ...
I am trying to create an LPeg pattern that would match any Unicode punctuation inside UTF-8 encoded input. I came up with the following marriage of Se ...
I've been working on a text editor that uses LPEG to implement syntax highlighting support. Getting things up and running was pretty simple, but I've ...
Can anyone provide a clear explanation and some simple examples that show this error, apparently related to match-time capture (Cmt) ? I don't unders ...
I'm new to the "LPeg" and "re" modules of Lua, currently I want to write a pattern based on following rules: Match the string that starts with "gv ...
I need to iterate over some pairs of strings in a program that I am writing. Instead of putting the string pairs in a big table-of-tables, I am puttin ...
I'm trying to capture a string with a combination of a's and b's but always ending with b. In other words: matching aaab and bbabb but not aaa or b ...
(I'm using Lua 5.2 and LPeg 0.12) Suppose I have a pattern P that produces some indeterminate number of captures, if any, and I want to write create ...
How would I go about doing a multiple pattern search in Lua? (I have Lpeg set up). For example, say I'm receiving strings in a row, I'm processing o ...
I've been using lunadry to reformat my code for me, but I've run into errors, namely, this happens when I try it: Now I've gone through a large chu ...
To match a string starting with dog, followed by cat(but not consuming cat), this works: Output: dog To match a string starting with dog, followed ...
In a normal PEG (parsing expression grammar) this is a valid grammar: values <- number (comma values)* number <- [0-9]+ comma <- ',' Howe ...