S
Stuart Clarke
I am having a few problems getting gsub to work with my regular
expressions.
I have a field full of data and therefore I am using a regular
expression to extract one part of it - #{event.description[/Logon
Type:\t2/]}
This works fine. I want to now add in gsub to replace 'Logon Type: 2'
with the string 'Local Logon' - #{event.description.gsub([/Logon
Type:\t2/], 'Local Logon')}
However when i run this code i get the following error:
C:/Documents and Settings/sc/Desktop/test.rb:116:in `gsub': wrong
argumen
t type Array (expected Regexp) (TypeError)
Does anyone have any ideas where I am going wrong?
Many thanks
expressions.
I have a field full of data and therefore I am using a regular
expression to extract one part of it - #{event.description[/Logon
Type:\t2/]}
This works fine. I want to now add in gsub to replace 'Logon Type: 2'
with the string 'Local Logon' - #{event.description.gsub([/Logon
Type:\t2/], 'Local Logon')}
However when i run this code i get the following error:
C:/Documents and Settings/sc/Desktop/test.rb:116:in `gsub': wrong
argumen
t type Array (expected Regexp) (TypeError)
Does anyone have any ideas where I am going wrong?
Many thanks