> Another practical usage I've heard: match "string" or 'string', but not "string'. You don't need backreferences for that: '[^']*'|"[^"]*"
Sat solver on top of regex matcher
11–20 of 53 posts
Re: Sat solver on top of regex matcher
#12This 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?
Re: Sat solver on top of regex matcher
#13This 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?
I wouldn't say so, but I use the term "regular language" if I mean the mathematical concept.
Re: Sat solver on top of regex matcher
#14> 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.
Re: Sat solver on top of regex matcher
#15Earlier quoted context omitted.
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.
Backreferences don't really help with those problems. > 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 quo…
query = "select * from table where name like \"%foo\""Re: Sat solver on top of regex matcher
#16Re: Sat solver on top of regex matcher
#17Took 9min and 10seconds on RPi 3 running Ubuntu 20.04. Consuming 100% CPU and 1% RAM (1024MB).
Re: Sat solver on top of regex matcher
#18One of the cool features of SAT problems is that they always terminate (if you're patient enough). Aren't regex, especially with backreferences, Turing-complete though? If so, they could be caught in an infinite loop, meaning they are more general than the SAT problem.
Still, yes, you can mess up your "add 1 to the input" program and make it run infinitely.
Re: Sat solver on top of regex matcher
#19Re: Sat solver on top of regex matcher
#20This 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?