Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. ghcid t.hs --test=":! liquid t.hs t.hs" --restart=t.hs
  2.  
  3.  
  4. x = f f x
  5.  
  6. f o g = f g
  7.  
  8. f g (f g)
  9.  
  10.  
  11.  
  12. en bokstav matcher "seg selv"
  13.  
  14. "a" matcher a . matcher == -
  15. "a" - a
  16. "B" - B
  17.  
  18. . matcher alt
  19.  
  20.  
  21. "a" - .
  22. "B" - .
  23.  
  24. * matcher 0 eller flere av noe
  25.  
  26. "a" - a* (1)
  27. "aaa" - a* (3)
  28. "" - a* (0)
  29. "abab" - (ab)* (2)
  30. MATCHER IKKE "aba" !- (ab)*
  31.  
  32. r1 | r2 matcher hvis det er r1 eller r2
  33.  
  34. "a" - a|b
  35. "b" - a|b
  36. "ab" - ab|b
  37. "BaB" - (B|a)*
  38. MATCHER IKKE "BB" !- (B|a)a
  39.  
  40. Alt dette kan blandes sammen :)
  41.  
  42. feks noe som matcher mange a-er så mange b-er
  43. a*b*
  44.  
  45. matcher 3 av hva som helst og så 2 a-er
  46. ...aa
  47.  
  48. matcher enten mange (3 a-er eller 3 A-er)
  49. (aaa | AAA) *
  50. "aaa"
  51. "aaaAAAAAAaaa"
  52.  
  53. Hvordan bruke i java?
  54. "aaaAAAAAAaaa".matches("(aaa | AAA)*") => gir true
  55. "aaaa".matches("(aaa | AAA)*") => gir false
  56.  
  57. \\d matcher et siffer btw
  58.  
  59.  
  60.  
  61. Så hvordan matche på EK og EL?
  62. Tips: alternativ (|) og matche-alle (.). Og Kanskje *
  63. f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement