http://regexcrossword.com/challenges/intermediate/puzzles/5 Anyone understand what (.)*DO\1 should match? edit: Okay, I was writting 0 instead of O that's why it wasn't working.
DO
DONUT
DOG61–70 of 115 posts
http://regexcrossword.com/challenges/intermediate/puzzles/5 Anyone understand what (.)*DO\1 should match? edit: Okay, I was writting 0 instead of O that's why it wasn't working.
DO
DONUT
DOGhttp://regexcrossword.com/challenges/intermediate/puzzles/5 Anyone understand what (.)*DO\1 should match? edit: Okay, I was writting 0 instead of O that's why it wasn't working.
(.) -> any character, grouped to reference it, since it's the first group it's referenced as \1
(.)* -> that, 0 or more times
(.)* DO -> any character 0 or more times, followed by DO
(.)* DO\1 -> any character 0 or more times, followed by DO, and the same character as in the beginning
My main problem with this is telling the difference between O and 0, the clue O's look more like 0 so I have to copy paste them. (Although I don't think I've had any numbers required for solutions yet).
The zeroes have a slash through them on my browser - does yours not have that?
I really dislike that patterns using * wildcard required using the letters beforehand. The game requires A* to match a row with zero or more A's, but this is absolutely incorrect, as A* will gladly match ANY string, like QQQQ.
A* is "the set of all strings over the alphabet {A}, including the empty string ε."
"QQQQ" is not a string over the alphabet {A} because it contains the symbol 'Q', which is not in {A}.
Alphabet: [01]
Number of variables: N
Columns: one for each clause, i.e.:
r/.0...|..1..|....1/
(-x2 V x3 V x5)
They're disjunctions of three regexps of length N. Each alternative fixes one positional variable to either 0 or 1, and ignores the rest.Rows: one for each variable, forcing it to be single-valued across the clauses:
r/0+|1+/I really dislike that patterns using * wildcard required using the letters beforehand. The game requires A* to match a row with zero or more A's, but this is absolutely incorrect, as A* will gladly match ANY string, like QQQQ.
What does it mean when a reg ex ends with a `\1` (backslash 1) as in this example third beginner puzzle? (.)+\1 http://regexcrossword.com/challenges/beginner/puzzles/3
(.*)+\1
would match "ABAB", or "ABCABC", etc."\2" would match the second capture group, e.x.
(.*)(.*)\2\1
would match "ABBA", or "AABBBBAA", etc.What does it mean when a reg ex ends with a `\1` (backslash 1) as in this example third beginner puzzle? (.)+\1 http://regexcrossword.com/challenges/beginner/puzzles/3
What does it mean when a reg ex ends with a `\1` (backslash 1) as in this example third beginner puzzle? (.)+\1 http://regexcrossword.com/challenges/beginner/puzzles/3