Sat solver on top of regex matcher
yurichev.com
Sat solver on top of regex matcher
1–10 of 53 posts
Re: Sat solver on top of regex matcher
#2Is there a general consensus to use "regular expression" to refer to the actual regular ones and "regex" to refer to the non-regular variants?
Re: Sat solver on top of regex matcher
#3You don't need backreferences for that:
'[^']*'|"[^"]*"Re: Sat solver on top of regex matcher
#4> Another practical usage I've heard: match "string" or 'string', but not "string'. You don't need backreferences for that: '[^']*'|"[^"]*"
Re: Sat solver on top of regex matcher
#5This reduction is really cool. I love reductions like this. Is there a general consensus to use "regular expression" to refer to the actual regular ones and "regex" to refer to the non-regular variants?
# math and/or computer science texts? It's the regular ones.
# pretty much elsewhere? It's the extended ones.
# threads about parsing HTML with regular expressions? People using both and insisting their version is the only correct one.
Re: Sat solver on top of regex matcher
#6> Another practical usage I've heard: match "string" or 'string', but not "string'. You don't need backreferences for that: '[^']*'|"[^"]*"
Won't work if you're already in a string, or if there are escaped quotes in the string. Also won't work if you have two or more double quoted strings that both contain an apostrophe.
/"([^"\\]|\\.)*"/
Now double that up with a single quote version if you wish.What you can't match without backreferences, however, is strings with customisable terminators, e.g. the behaviour in sed that whatever character you use after `s` is the regex terminator (it doesn't have to be `/`), or raw strings in C++.
Re: Sat solver on top of regex matcher
#7> Another practical usage I've heard: match "string" or 'string', but not "string'. You don't need backreferences for that: '[^']*'|"[^"]*"
Won't work if you're already in a string, or if there are escaped quotes in the string. Also won't work if you have two or more double quoted strings that both contain an apostrophe.
> Won't work if you're already in a string
This doesn't make sense. How can you search for a string if you're already in a string? I can't think of a realistic situation where that would be useful or even really possible.
> or if there are escaped quotes in the string.
Solvable:
'(\'|\\|[^\'])*'|"(\"|\\|[^\"])*"
> Also won't work if you have two or more double quoted strings that both contain an apostrophe.The regex in my previous comment already solves that. See: https://repl.it/repls/SolidCapitalProgram
Re: Sat solver on top of regex matcher
#8> Another practical usage I've heard: match "string" or 'string', but not "string'. You don't need backreferences for that: '[^']*'|"[^"]*"
Re: Sat solver on top of regex matcher
#9This reduction is really cool. I love reductions like this. Is there a general consensus to use "regular expression" to refer to the actual regular ones and "regex" to refer to the non-regular variants?
https://docs.raku.org/language/regexes (see the intro paragraph)
Re: Sat solver on top of regex matcher
#10This reduction is really cool. I love reductions like this. Is there a general consensus to use "regular expression" to refer to the actual regular ones and "regex" to refer to the non-regular variants?