Merge branch 'master' of github.com:kiooeht/pesterchum
This commit is contained in:
commit
308024a93b
2 changed files with 197 additions and 17 deletions
22
README.mkdn
22
README.mkdn
|
@ -550,16 +550,18 @@ as well.
|
||||||
can combine them, too: [a-z0-9] will match any digit and lowercase letter.
|
can combine them, too: [a-z0-9] will match any digit and lowercase letter.
|
||||||
|
|
||||||
There are also different shortcuts for character types:
|
There are also different shortcuts for character types:
|
||||||
* \d matches any digit; same as [0-9]
|
<pre>
|
||||||
* \D matches any non-digit; same as [^0-9]
|
\d matches any digit; same as [0-9]
|
||||||
* \s matches any spaces
|
\D matches any non-digit; same as [^0-9]
|
||||||
* \S matches any non-space
|
\s matches any spaces
|
||||||
* \w matches any alphanumeric character; same as [a-zA-Z0-9_]
|
\S matches any non-space
|
||||||
* \W matches any non-alphanumeric character; same as [^a-zA-Z0-9_]
|
\w matches any alphanumeric character; same as [a-zA-Z0-9_]
|
||||||
|
\W matches any non-alphanumeric character; same as [^a-zA-Z0-9_]
|
||||||
|
</pre>
|
||||||
|
|
||||||
You can include this inside brackets, too.
|
You can include this inside brackets, too.
|
||||||
|
|
||||||
There's also a special character, \b. What \b does is make sure that
|
There's also a special character, \\b. What \\b does is make sure that
|
||||||
you are at the beginning or end of a word.
|
you are at the beginning or end of a word.
|
||||||
* So with that knowledge, let's try Kanaya:
|
* So with that knowledge, let's try Kanaya:
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -570,12 +572,12 @@ as well.
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Another feature of regular expressions is the ability to match
|
Another feature of regular expressions is the ability to match
|
||||||
*repeated* characters. There are three repeat characters: the "*", the
|
*repeated* characters. There are three repeat characters: the "\*", the
|
||||||
"+", "?", and "{m,n}". They work by playing them after the character,
|
"+", "?", and "{m,n}". They work by playing them after the character,
|
||||||
or character type you want to match. (So, you could say "\s+" or ".*")
|
or character type you want to match. (So, you could say "\s+" or ".*")
|
||||||
|
|
||||||
The "*" character matches ZERO or more of that character. So, for
|
The "\*" character matches ZERO or more of that character. So, for
|
||||||
example, "f*" would match "f" and "ff" -- and any other character!
|
example, "f\*" would match "f" and "ff" -- and any other character!
|
||||||
That's right, every character counts as matching it zero times. Yeah,
|
That's right, every character counts as matching it zero times. Yeah,
|
||||||
it's weird. I suggest you use...
|
it's weird. I suggest you use...
|
||||||
|
|
||||||
|
|
178
trollquirks.mkdn
Normal file
178
trollquirks.mkdn
Normal file
|
@ -0,0 +1,178 @@
|
||||||
|
Troll Quirks
|
||||||
|
============
|
||||||
|
|
||||||
|
Karkat
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "(.)"
|
||||||
|
REPLACED WITH: "upper(\1)"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Aradia
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[oO]"
|
||||||
|
REPLACE WITH: "0"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
#####After Prototyping
|
||||||
|
<pre>
|
||||||
|
RANDOM REGEXP: "\s"
|
||||||
|
REPLACED WITH: " ribbit ", " ", " ", " ", " ", " ", etc....
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Tavros
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "\b(\w)(\w*)"
|
||||||
|
REPLACED WITH: "lower(\1)upper(\2)"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "\.?"
|
||||||
|
WITH: ","
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Sollux
|
||||||
|
------
|
||||||
|
#####Pre-blind
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[iI]"
|
||||||
|
REPLACE WITH: "\1\1"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[sS]"
|
||||||
|
REPLACE WITH: "2"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "\btoo?\b"
|
||||||
|
REPLACE WITH: "two"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
#####Blind
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[oO]"
|
||||||
|
REPLACE WITH: "0"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Nepeta
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
PREFIX: ":33 < "
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[eE][eE]"
|
||||||
|
REPLACE WITH: "33"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Kanaya
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "\b(\w)"
|
||||||
|
REPLACE WITH: "upper(\1)
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Terezi
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[aA]"
|
||||||
|
REPLACE WITH: "4"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[iI]"
|
||||||
|
REPLACE WITH: "1"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[eE]"
|
||||||
|
REPLACE WITH: "3"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "(.)"
|
||||||
|
REPLACE WITH: "upper(\1)"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Vriska
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[bB]"
|
||||||
|
REPLACE WITH: "8"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
RANDOM REGEXP: "([aeiouAEIOU])"
|
||||||
|
REPLACE WITH: "\1\1\1\1\1\1\1\1", "\1", "\1", "\1", "\1", "\1", etc........
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
RANDOM REGEXP: "([\.\?,!]$)"
|
||||||
|
REPLACE WITH: "\1\1\1\1\1\1\1\1", "\1", "\1", "\1", "\1", "\1", etc........
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REPLACE: ":"
|
||||||
|
WITH: "::::"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Keep in mind that the RANDOM REGEXP ones require the extra "\\1"s to be added in order to not happen all the time. If you want those quirks to happen less often, add more "\\1".
|
||||||
|
|
||||||
|
Equius
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
PREFIX: "D --> "
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[lL][oO][oO]"
|
||||||
|
REPLACE WITH: "100"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[xX]"
|
||||||
|
REPLACE WITH: "%"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "(\b[sS][tT][rR][oO][nN][gG]\w*)"
|
||||||
|
REPLACE WITH: "upper(\1)"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "[oO][oO]"
|
||||||
|
REPLACE WITH: "00"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Gamzee
|
||||||
|
------
|
||||||
|
#####Version 1: "HoNk HoNk"
|
||||||
|
<pre>
|
||||||
|
REGEXP: "([a-zA-Z])([a-zA-Z])"
|
||||||
|
REPLACED WITH: "upper(\1)\2"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "([a-z])([a-z])\b"
|
||||||
|
REPLACED WITH: "\1upper(\2)"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
#####Version 2: "HoNk hOnK"
|
||||||
|
<pre>
|
||||||
|
REGEXP: "(.)(.)"
|
||||||
|
REPLACED WITH: "upper(\1)\2"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "([a-z])(.)\b"
|
||||||
|
REPLACE WITH: "\1upper(\2)"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Eridan
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: "([vVwW])"
|
||||||
|
REPLACE WITH: "\1\1"
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REGEXP: "ing\b"
|
||||||
|
REPLACE WITH: "in"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Feferi
|
||||||
|
------
|
||||||
|
<pre>
|
||||||
|
REGEXP: [hH]
|
||||||
|
REPLACE WITH: ")("
|
||||||
|
</pre>
|
||||||
|
<pre>
|
||||||
|
REPLACE: "E"
|
||||||
|
WITH: "-E"
|
||||||
|
</pre>
|
Loading…
Reference in a new issue