[Rubyinstaller-devel] String Manipulation in Ruby

Vincent Predoehl vpredoehl at phoenixwebgroup.com
Wed Jul 5 22:32:08 EDT 2006


I need to parse this string for the href text:

linkHTML = "<a href="javascript:{if (typeof(Page_ClientValidate) !=  
'function' ||  Page_ClientValidate()) __doPostBack('CustMstr_repeater 
$_ctl1$_ctl0','')} ">Accounts</a>"

This is ultimately what I need to end up with:

s = "javascript:{if (typeof(Page_ClientValidate) != 'function' ||   
Page_ClientValidate()) top.frames[0].__doPostBack('CustMstr_repeater 
$_ctl1$_ctl0','')} "

The one thing making my life ahrd is that 'top.frames[0].' needs to  
be inserted before the __doPostBack so it will work.  I'm a Ruby noob  
and I don't know anything about RegExp.  Are there string  
manipulation methods I can use to do the job?

Thanks,
-- 
Vincent





More information about the Rubyinstaller-devel mailing list