Large multi-line regex needed
See original GitHub issuefrom lark import *
grammar = r"""
expr :
var
ANY
var :
var_atom [script]
var_atom: /[a-zA-Z]|\\alpha|\\beta|\\gamma|\\delta|\\epsilon
|\\zeta|\\eta|\\theta|\\vartheta|\\iota
|\\kappa|\\lambda|\\mu|\\nu|\\xi|\\pi
|\\rho|\\varrho|\\sigma|\\tau|\\upsilon
|\\phi|\\varphi|\\chi|\\psi|\\omega
|\\Gamma|\\Delta|\\Theta|\\Xi|\\Pi|\\Sigma
|\\Upsilon|\\Phi|\\Psi|\\Omega/
script: ANY
ANY: /./+
%import common.WS
%ignore WS
"""
if __name__ == '__main__':
var_parser = Lark(grammar, start='expr')
while True:
s = input('s=')
tree = var_parser.parse(s)
print(tree.pretty())
Results in NL errors.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
regex - How do I match any character across multiple lines in ...
The dot matches all except newlines (\r\n). So use \s\S, which will match ALL characters. Share.
Read more >Multiline Regexp - EmacsWiki
Multi-line regular expressions would require Emacs to skip backwards multiple lines and see if any of the multi-line regular expression ...
Read more >Regular Expression To Match Multiple Lines Of Text
I am using Visual Studio 17s find and replace component. Using a regular expression, I am trying to match and remove those description...
Read more >Matching against multi-line strings with Java regular expressions
Tutorial and hints on matching regular expressions in Java against strings containing multiple lines.
Read more >Multiline mode of anchors ^ $, flag "m"
And at the text start. Searching at line end $. The dollar sign $ behaves similarly. The regular expression \d$ finds the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just for the record, this should work:
Yes, that looks alright