Normal Text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Negabase | |
| * To convert a decimal to negative base. | |
| * Divide the number by the negative base. | |
| * Acquire the whole number quotient and remainder. | |
| * If the remainder is negative, add 1 to the quotient and add the absolute value of the base to the remainder. | |
| * Divide the quotient by the negative base... rinse and repeat until the quotient is 0. | |
| * Aggregate the remainders in reverse (as a stack), and you have your negative base representation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
