underwoodrockz Publish time 16-2-2012 11:14 AM

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?

kmkd Publish time 16-2-2012 10:00 PM

aku tak paham act apa soalannya ni..

tapi kalau nak create hexadecimal using regex

/^0x{1,4}$/i

underwoodrockz Publish time 16-2-2012 11:06 PM

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 :)

kmkd Publish time 17-2-2012 06:42 AM

ok :D

underwoodrockz Publish time 17-2-2012 11:29 AM

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.... :'(

otai_g Publish time 17-2-2012 12:10 PM

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)/)

otai_g Publish time 17-2-2012 12:11 PM

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...

underwoodrockz Publish time 17-2-2012 02:28 PM

ok. da dapat gak. hahahaha :lol:

underwoodrockz Publish time 17-2-2012 02:32 PM

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]
View full version: Regular Expression.. MARI TOLONG!!!


ADVERTISEMENT