Comments (8)
It was a bug in parsing character sets in patterns. It has been fixed in commit 3d22db5.
from luerl.
This looks good, thank you.
I saw yet another difference:
lua
:
> print(string.find('<a><b>1</b><c a="1">2</c></a>', '^([^<]*)<(%/?)([^>]-)(%/?)>', 4))
4 6 b
luerl
:
> luerl:do("print(string.find(\"<a><b>1</b><c a=\\\"1\\\">2</c></a>\",\"^([^<]*)<(%/?)([^>]-)(%/?)>\", 4))").
nil
from luerl.
It was a bug in how the beginning of string anchor '^' was handled when not starting at the beginning of the string. It now follows Lua. It has been fixed in commit 5c1feb7.
from luerl.
I still experience those differences:
> print(string.find("<a>1</a>", "^([^<]*)<(%/?)([^>]-)(%/?)>", 4))
4 8 1 / a
> luerl:do("print(string.find(\"<a>1</a>\",\"^([^<]*)<(%/?)([^>]-)(%/?)>\", 4))").
4 8 < a >
from luerl.
You haven't heard the adage: I had a problem so I used regular expressions, now I have two problems. I will check but I am guessing I just counted wrong as the chars are one position off.
from luerl.
Ha! I hope i will soon get to know this part good enough to send not only bug reports, but also patches ;-)
from luerl.
I was counting the offsets incorrectly. It now works on all your 3 test cases so far. It has been fixed in commit 63833f8.
If you have any cases to test for string.match, string.gsub and string.format please run them as well.
from luerl.
That worked! Here is my little side project as POC of how someone can use luerl, xml parser: https://github.com/loucash/luerlxml
from luerl.
Related Issues (20)
- Handling multiple versions of Lua HOT 1
- Unicode string, different length in same lua code HOT 5
- luerl.do returns raw table reference instead of decoded value HOT 3
- Persistent data structures HOT 15
- os.time and os.date API incorrectly implemented HOT 3
- 5.3 converting hex string to decimal error
- The collectgarbage() function is for now a no-op HOT 2
- Release request: 5.3 beta version HOT 3
- Loading third-party library redis failed HOT 3
- Whether to support multi-lua script file parsing HOT 3
- What the 'Reductions' meaning in sandbox? HOT 2
- ability to run lua program line-by-line / pause execution and return to caller HOT 4
- failed to add "require" to the lua script
- string.format crash and inconsistency HOT 4
- Update luerl in hex.pm HOT 4
- more documentation for Mod:install in load_module
- pcall and division by zero HOT 6
- Executing a Lua function from within Elixir does not return the mutated state HOT 5
- Garbage collector removes environment for functions stored in a table in _G HOT 3
- store/retrieve luerl_state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luerl.