In regex, |
is used for alternation. What is the corresponding character in Lua patterns?
相关问题
- How to get the return code of a shell script in lu
- Accessing Light userdata in Lua
- Wireshark dissector that works with tls/ssl
- Email address validation using corona sdk
- Using a coordinate pair as a key in a Lua table
相关文章
- Lua Integer type
- First character uppercase Lua
- torch / lua: retrieving n-best subset from Tensor
- How to handle errors when resuming a Lua thread (c
- Is Lua an object-oriented language?
- Getting previous day's date in Lua
- How do I create a save game feature in love2d?
- What is the best way for debug output for the lua
Another workaround is: Instead of:
Write:
Explanation: match alternate letters from each word. voila!
First, note that Lua patterns are not regular expressions; they are their own simpler matching language (with different benefits and drawbacks).
Per the specification I've linked to above, and per this answer, there is no alternation operator in a Lua pattern. To get this functionality you'll need to use a more powerful Lua construct (like LPEG or a Lua Regex Library).