david_williams | 75261a8 | 2010-04-22 05:50:25 +0000 | [diff] [blame] | 1 | "test\\".matches(".*" + "\\\\" + " *" + "$") |
| 2 | |
| 3 | char CR = 0x0d; |
| 4 | char LF = 0x0a; |
| 5 | String testeols="" + CR + LF + CR + LF + LF; |
| 6 | byte[] testconvert = testeols.getBytes("UTF8"); |
| 7 | |
| 8 | System.out.println(testeols); |
david_williams | 201ad5d | 2010-04-23 07:59:07 +0000 | [diff] [blame] | 9 | |
| 10 | |':'|'\u0020'|'\u0009'|'\u000C'"; |
| 11 | |
| 12 | *'='.*$"; |
| 13 | |
| 14 | String ANY_NONEOL_WHITESPACE = "[ \\t\\f\\x08]*"; |
| 15 | String ANY_END = ".*$"; |
| 16 | String ONE_PROPERTY_DELIMITER = "[=:]"; |
| 17 | |
| 18 | String LICENSE_KEY = "^" + ANY_NONEOL_WHITESPACE + "license" + ANY_NONEOL_WHITESPACE + ONE_PROPERTY_DELIMITER + ANY_END; |
| 19 | |
| 20 | String testString = "license=test"; |
| 21 | System.out.println(testString + " " + testString.matches(LICENSE_KEY)); |
| 22 | |
| 23 | testString = " license = test"; |
| 24 | System.out.println(testString + " " + testString.matches(LICENSE_KEY)); |
| 25 | |
| 26 | testString = " license = test"; |
| 27 | System.out.println(testString + " " + testString.matches(LICENSE_KEY)); |
| 28 | |
| 29 | testString = " license = test"; |
| 30 | System.out.println(testString + " " + testString.matches(LICENSE_KEY)); |
| 31 | |
| 32 | testString = " license = \\\n test"; |
| 33 | System.out.println(testString + " " + testString.matches(LICENSE_KEY)); |
| 34 | |
| 35 | testString = " xx license = test"; |
| 36 | System.out.println(testString + " " + testString.matches(LICENSE_KEY)); |
| 37 | |
david_williams | c6eb534 | 2010-05-07 01:52:59 +0000 | [diff] [blame] | 38 | 1024 * 1024 |
david_williams | 201ad5d | 2010-04-23 07:59:07 +0000 | [diff] [blame] | 39 | |
david_williams | c6eb534 | 2010-05-07 01:52:59 +0000 | [diff] [blame] | 40 | 2 ^ 3 |
| 41 | |
| 42 | |
| 43 | long x = (Runtime.getRuntime().maxMemory()) / (1024*1024); |
| 44 | System.out.println(x); |
david_williams | 201ad5d | 2010-04-23 07:59:07 +0000 | [diff] [blame] | 45 | |