[Question]
  [
Your task here is to write two regular expressions, each of which matches the other one but does not match itself.
Both regular expressions should have this form:
```
/pattern/optional-flags
```
This is also the form in which they should be matched.
The shortest solution wins. The solution length is counted as the sum of characters in both regular expressions including slashes and flags.
Use a regex syntax standard of your choice, or specify a programming language, when it makes a difference.
Have fun!
  
[Answer]
# 4+6=score of 10
First regex:
```
/i$/
```
Second regex:
```
/^.i/i
```
Hooray for flag abuse! :-P
The first one matches anything that ends with `i` (therefore, any regex with the `i` flag).
The second one matches anything with a second character of `i`.
Alternative version: `/i$/g` and `/g$/i`.
[Answer]
## PRCE with the A modifier: 9 chars
```
/A$/
/.A/A
```
Although this is a variant on Doorknob's `/modifier$/` answer, I think this innovation qualifies it as a separate answer rather than a comment on his: the modifier does double-duty. Rather than being there solely for the other regex to match, it anchors.
The first regex matches any string ending in a literal `A`. The second regex matches any string whose second character is a literal `A`, using an anchor-to-start flag.
[Online demo](http://ideone.com/iHaQrv)
[Answer]
## JavaScript regexes, score: 18
First regex:
```
/^[^a]+$/
```
Second regex:
```
/^[^b]+$/
```
JavaScript test:
```
var regex1 = "/^[^a]+$/";
var regex2 = "/^[^b]+$/";
alert(/^[^a]+$/.test(regex2)); // true: regex1 matches regex2
alert(/^[^b]+$/.test(regex1)); // true: regex2 matches regex1
alert(/^[^a]+$/.test(regex1)); // false: regex1 doesn't match regex1
alert(/^[^b]+$/.test(regex2)); // false: regex2 doesn't match regex2
```
Test online: <http://jsfiddle.net/99Sx6/>
[Answer]
## Ruby regex, 15
Regular expressions:
```
/.{9}/
/^.{06}$/
```
Just counting characters...
[Online version](http://repl.it/PZc/1)
```
r1 = '/.{9}/'
r2 = '/^.{06}$/'
p r1 =~ /^.{06}$/ #0:   r2 matches r1
p r2 =~ /.{9}/    #0:   r1 matches r2
p r1 =~ /.{9}/    #nil: r1 doesn't match r1
p r2 =~ /^.{06}$/ #nil: r2 doesn't match r2
```
[Answer]
# 4 + 6 = 10
First regex:
```
/i$/
```
Second regex:
```
/\/$/i
```
`i$` matches something that ends with `i`, the second one. `/$` matches something that ends with `/`, the first one.
[Answer]
# 5 + 5 = 10
Regex #1:
```
/0.$/
```
Regex #2:
```
/^.0/
```
The `0`s in both regexes can be replaced with any non-metacharacter and the regex still works.
`0.$` matches anything whose second last character is `0`, and `^.0` matches anything whose second character is `0`.
[Answer]
# Score: 5 + 5 = 10
Took me half-an-hour to figure out but I am really happy that I did :)
### 1st is: `/j.$/`
### 2nd is: `/^.j/`
The 1st matched a `j` occurring in the second position starting from the right. The 2nd matches a `j` occurring at the second-position starting from left.
I haven't tested but I think that these RegExs are really versatile as the `j` can be replaced with any `\w` character (or more?) and still should work fine.
P.S. This should (hopefully) work in any language. Though, if it does not work in any, please inform in the comments below :)
[Test](http://jsbin.com/vimugula/1/edit)
[Answer]
## JavaScript regexes, score: 13
First regex:
```
/\d/
```
Second regex:
```
/^[^0]+$/
```
Explanation: the first regex matches everything that contains a digit, and the second regex matches everything that doesn't contain a `0`.
JavaScript test:
```
var regex1 = "/\d/";
var regex2 = "/^[^0]+$/";
alert(/\d/.test(regex2)); // true: regex1 matches regex2
alert(/^[^0]+$/.test(regex1)); // true: regex2 matches regex1
alert(/\d/.test(regex1)); // false: regex1 doesn't match regex1
alert(/^[^0]+$/.test(regex2)); // false: regex2 doesn't math regex2
```
Test online: <http://jsfiddle.net/5VYjC/1/>
[Answer]
**12 chars** ;) JS regex
```
/\d/
/0?\/$/g
```
[Answer]
### PCRE using modifier x: 11 chars
```
/\s/
/ s.$/x
```
The first matches any string with a whitespace character, but doesn't contain whitespace. The second contains whitespace, but it's ignored because of the `x` modifier; it matches any string whose penultimate character is `s`.
### PCRE and other engines using character classes: 11 chars
```
/\w+w/
/\Ww/
```
The first matches any string with a "word" character (letter, digit, underscore) followed by a literal `w`; the second matches any string with a non-word character followed by a literal `w`.
### PCRE and other engines using character classes and word boundary anchor: 11 chars
```
/\w\w/
/\bw/
```
The first matches any string with two consecutive "word" characters; the second any string with a non-word character or start of string followed by a literal `w`.
[Answer]
# ECMAScript (11 bytes):
```
/^\1?d/
/\d/
```
# Other REGEXP Engines (14 bytes):
```
/^\\\\1?d/
/\d/
```
The 1st matches \d[..] or \1d[..].
The second matches any string with a number.
**EDIT:**
Originally, this answer was posted as being compatible with all engines, but it was proven to be wrong.
There was a problem with references to the capturing groups (for example, in php).
]