2015-12-26 43 views
0

如何才能找到正則表達式(0-9,a-f)和(m,n,o,k)的十六進制字符?正則表達式Hex Chars

+0

爲什麼M,N,O,K? – erip

+0

這與十六進制字符相匹配:'[0-9a-fA-F]'如果你還想匹配mnok,你可以在方括號中列出它們:'[0-9a-fA-Fmnok]' – Tuure

回答

0

使用以下正則表達式:

[0-9a-fA-FmnokMNOK] 

說明:

[     #Match a single character present in the group (look below) 
0-9     #All numbers from 0 to 9 
    a-fA-F   #Characters from a to f (lowercase and uppercase) 
      mnokMNOK #The characters m, n, o and k (lowercase and uppercase) 
        ] #End of character group 

這裏試試:https://regex101.com/r/jT1iY3/3 - 這也是它向你解釋右側立柱。