[ruby-it] gsub and reg expressions
Stuart Clarke
stuart.clarke1986 a gmail.com
Dom 16 Nov 2008 18:33:25 CET
After considerable time racking my brains on this one I am unsure on
where to go.
I am trying to replace some text with a the string 'local'
I am reading some data from an event description, therefore using a
regular expression to get only the data i want which is 'Logon Type: 2'
This works fine but when I add gsub to the expression in an attempt to
replace 'Logon Type: 2' with "local" I get the following error:
C:/Documents and Settings/sc/Desktop/stutest.rb:116:in `gsub': wrong
argumen
t type Array (expected Regexp) (TypeError)
Also my code
#{event.description.gsub([/Logon Type:\t2/], 'Local')}")
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
More information about the Ml
mailing list