pball

regex info for mirc

Nov 29th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. \d{5} -- would match a substring of five digits
  2. \d{,4} -- would match a substring of zero to four digits
  3. \d{6,} -- would match a substring of at least six digits
  4.  
  5. \x03 (3) -- matches the color symbol (mIRC's ctrl+k)
  6. \x02 (2) -- matches the bold symbol (mIRC's ctrl+b)
  7. \x0f (15) -- matches the control-code strip character (mIRC's ctrl+o)
  8. \x1f (31) -- matches the underline symbol (mIRC's ctrl+u)
  9. \x16 (22) -- matches the reverse symbol (mIRC's ctrl+r)
  10. \x1d (29) -- matches the italics symbol (mIRC's ctrl+i) (mIRC 7 only)
  11.  
  12. (a)\1\1\1 -- the \1 would match a previous group, the first one for \1, 2nd for \2, etc. as if for duplicates in a string, in this case: aaaa
  13. Text: 'joey the joelster wanted to get a cup of joe'
  14. Regex1: (joe)y the \1lster wanted to get a cup of \1 -- Simple grouping example
  15. Regex2: (joe)y (t)h(e) \1ls\2\3r w(a)n\2\3d \2(o) g\3\2 \4 cup \5f \1 -- As you see, abuse of grouping (please don't do this!!)
  16. Regex3: (joe.*?){3} -- Serious inclusion abuse to match three uses of 'joe' followed by some set of unknown text.
  17. Regex4: [Jj]oey the [Jj]oelster wanted to get a cup of joe -- Example of potentially unknown capitalization of a word
  18. Regex5: joey.the.joelster.wanted.to.get.a.cup.of.joe -- Would allow for potential replacement of the spaces with underscores
  19. (aab){5} -- would match the repeating substring of 'aabaabaabaabaab'
  20.  
  21. * = 0-inf
  22. + = 1-inf
  23. . = 1
  24. ? = 0 or 1
  25.  
  26. Special characters: [\^$.|?*+()
  27.  
  28. [] -- match single character of contents, EX [a-z] matches any lower case letter
  29. [^] -- excludes contents, EX [^a-z] excludes lower case letters from match
  30. \d -- single digit, [0-9]
  31. \w -- single alphanumeric or underscore, [A-Za-z0-9_]
  32. \s -- space, tab, hardspace (chr 160)
  33. \t -- tab (0x09)
  34. \r -- return carriage (0x0D)
  35. \n -- line feed (0x0A)
  36. \b -- match word boundry, -, and more !!!!!DON'T USE!!!!!
  37. \xFF -- FF being hexidecimal value for a character
  38. ^ -- start of string
  39. $ -- end of string
  40. //i -- case insensetive
  41. //S -- strip
  42. //g -- global search
  43. \l lowercase next char (think vi)
  44. \u uppercase next char (think vi)
  45. \L lowercase till \E (think vi)
  46. \U uppercase till \E (think vi)
  47. \E end case modification (think vi)
  48. \Q quote (disable) pattern metacharacters till \E
  49.  
Advertisement
Add Comment
Please, Sign In to add comment