Regular Expression.. MARI TOLONG!!!
hi,aku ade prob keje ni. da tny senior pun die xtau. skrg ni aku de prob ttg regular expression. aku tgk die convert regular expression tu into hexadecimal.. aku xtau camne cara die convert...
ni contoh die...
// Pre-compiled regular expression '^\{\}\:\,\.\?\/\-\\\_\=\'\| ]+$'
private static char[] customAllowedCharacterPatternInstructions =
{
0x007c, 0x0000, 0x0058, 0x005e, 0x0000, 0x0003, 0x005b,
0x0020, 0x0043, 0x0030, 0x0039, 0x0061, 0x007a, 0x0041,
0x005a, 0x000d, 0x000d, 0x000a, 0x000a, 0x007e, 0x007e,
0x0060, 0x0060, 0x0021, 0x0021, 0x0040, 0x0040, 0x0023,
0x0023, 0x0024, 0x0024, 0x005e, 0x005e, 0x0026, 0x0026,
0x002a, 0x002a, 0x0028, 0x0028, 0x0029, 0x0029, 0x005b,
0x005b, 0x005d, 0x005d, 0x007b, 0x007b, 0x007d, 0x007d,
0x003a, 0x003a, 0x002c, 0x002c, 0x002e, 0x002e, 0x003f,
0x003f, 0x002f, 0x002f, 0x002d, 0x002d, 0x005c, 0x005c,
0x005f, 0x005f, 0x003d, 0x003d, 0x0027, 0x0027, 0x007c,
0x007c, 0x0020, 0x0020, 0x007c, 0x0000, 0x0006, 0x0047,
0x0000, 0xffba, 0x007c, 0x0000, 0x0003, 0x004e, 0x0000,
0x0003, 0x0024, 0x0000, 0x0003, 0x0045, 0x0000, 0x0000,
};
bila aku test convert RE to hexadecimal based on RE yg kat atas tu gune unicode table, xjadi pun mcm bentuk ni.
anyone can help how die leh dapat bentuk HEXADECIMAL mcm tu daripada RE yg kat atas tu? aku tak paham act apa soalannya ni..
tapi kalau nak create hexadecimal using regex
/^0x{1,4}$/i soalan die, camne nak create hex from regex. da jumpa da cara actually. gune je library from jakarta-apache tu. td ter-blur jap. tq anyway :) ok :D ok
kmkd Post at 17-2-2012 06:42 http://mforum.cari.com.my/images/common/back.gif
ade lg. ade sape2 leh tolong x bagi regular expression supaya die boleh accept alphanumeric, _ (underscore). bracket (), dash - and slash / .....
help please.... :'( aku nak tolong tp 1st question pun dah kantoi.
btw apa yg aku tau regular expression atau bahasa mudahnya regex bnyk digunakan di dlm irc scripting utk detect perkataan2 yg mencarut dlm cenel.
cth -> //echo -a $regex(this is a test,/this is a (test|balloon|sausage)/) ade lg. ade sape2 leh tolong x bagi regular expression supaya die boleh accept alphanumeric, _ ( ...
underwoodrockz Post at 17-2-2012 11:29 http://mforum2.cari.com.my/images/common/back.gif
aku rs function regex ko yg post #1 tu leh sapot semua dah tu termasuk underscore n alphanumeric... ok. da dapat gak. hahahaha :lol: aku rs function regex ko yg post #1 tu leh sapot semua dah tu termasuk underscore n alphanumeric ...
otai_g Post at 17-2-2012 12:11 http://mforum.cari.com.my/images/common/back.gif
yg no 1 tu, sbb itu adelah pattern utk allowable pny characters pattern. bila ko masuk bnyk2 characters, akan jadi stack overflow. mmg library jakarta-apache tu problem die gitu kot.
so, aku ubah sket function die tu.. instead of checking ape yg allowable, aku check ape characters yg xleh field aku tu terima. so, checking lg sikit n die xgune bnyk sgt memory kot. at this moment mmg jalan elok la compare to yg 1st aku post tu.
Pages:
[1]