Making rbeautify.rb work with SciTE
I really like Paul Lutus’ Ruby Beautifier but it does not display properly in SciTE because it is missing the tabs on blank lines. Luckily its really easy to fix.
Assigning RegEx brackets into variables with Ruby
Ruby has the ability to reference the last RegEx used and extract portions of it to assign to variables.
Define a new search:
[sourcecode language='ruby']
line = “foo==>to the bar”
rx = Regexp.new(/(.*)(\=\=\>)(.*)/) # each bracket can be assigned to a variable
rx.match(line)
head = Regexp.last_match(1) # foo
middle = Regexp.last_match(2) # ==>
tail = Regexp.last_match(3) # bar
[/sourcecode]
you could also also use this by streamlining it in an if statement.
[sourcecode language='ruby']
line = “foo==>to
