Advertisement
Guest User

parse

a guest
May 5th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REBOL 0.48 KB | None | 0 0
  1. Red []
  2.  
  3. line: "The ##Test## word $$Kees$$ is $$Arie$$ nice ##Piet## word!" "$$"
  4.  
  5. parse line  [any [ [ [to "##" b1: (change/part b1 {<strong style="color: green">} next next b1)]
  6.                      [to "##" b2: (change/part b2 {</strong>} next next b2)]]
  7.                  | [ [to "$$" b1: (change/part b1 {<strong style="color: blue">} next next b1)]
  8.                      [to "$$" b2: (change/part b2 {</strong>} next next b2)]]
  9.                  ]
  10.              to end]
  11. print line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement