Closed gilou closed 9 years ago
Error:Unexpected char!
^(?<Date>\d{4}-\d{1,2}-\d{1,2})\s+(?<Time>\d{2}:\d{2}:\d{2}),?\d{3}\s+(?<LogLevel>INFO|DEBUG|WARN|ERROR|FATAL)\s+(?<PID>\d+)\s+(?<Logger>[a-zA-Z.]*)\s+-?\s+(?:(?<Memory>\[MEMORY:\s\d+,?\d+\w+\])\s+(?<TcpConnections>\[TCP CONNECTIONS:\s\d+,?\d+\])\s)?(?<Message>.*)$
--^
No cant handle named capture groups...
At present this tool focuses on JavaScript RegExp syntax, not PCRE. JavaScript RegExp doesn't support named capture groups.
I had consider implementing this feature,but because this tool's goal is conforming with 《ECMAScript Standard》 ,and which syntax to support is a problem,Python or PCRE or XRegExp?
Any more suggestions?
Ah, I didn't think about the ECMAScript by default, even though it makes sense for a .js.. ;) Well, PCRE integrated Python's notation (and .NET's) hehe, see http://pcre.org/pcre.txt
Merge with: https://github.com/JexCheng/regulex/issues/16
Hey, nice tool, I might use that to help others understand regexp better ;)
However, it seems your script doesn't handle named capture groups : Python's
(?P<name1>xxx)
to be refered as(?P=name1)
or Perl's(?<name1>)
=>\k<name1>
Might be fun to add to your parser...