Re: [Rails] gsub global operator

2019-02-05 Thread fugee ohu
On Tuesday, February 5, 2019 at 8:33:03 AM UTC-5, Walter Lee Davis wrote: > > > > On Feb 5, 2019, at 3:34 AM, fugee ohu > > wrote: > > > > Does gsub have a global operator? How do I gsub in cases where there are > multiple lines that need to be treated as a single string? > > What is the

Re: [Rails] gsub global operator

2019-02-05 Thread Walter Lee Davis
> On Feb 5, 2019, at 3:34 AM, fugee ohu wrote: > > Does gsub have a global operator? How do I gsub in cases where there are > multiple lines that need to be treated as a single string? What is the difference between sub() and gsub()?

[Rails] gsub global operator

2019-02-05 Thread fugee ohu
Does gsub have a global operator? How do I gsub in cases where there are multiple lines that need to be treated as a single string? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving

Re: [Rails] gsub appearing in xml

2012-08-10 Thread Colin Law
On 10 August 2012 03:28, Alexander Farley li...@ruby-forum.com wrote: I'm using the 'builder' gem. I create an XML builder, add a sequence of tags with inner text, then escape the HTML, then save the object. Problem: The following gsub tag is appearing in my XML that I didn't put there. gsub

[Rails] gsub appearing in xml

2012-08-09 Thread Alexander Farley
I'm using the 'builder' gem. I create an XML builder, add a sequence of tags with inner text, then escape the HTML, then save the object. Problem: The following gsub tag is appearing in my XML that I didn't put there. gsub =amp;amp; =amp;quot; =amp;lt; =amp;gt;(?-mix:[amp;\lt;gt;])/gsub Can

Re: [Rails] gsub

2012-03-26 Thread Aaron Schmitz
yep. i didnt escape the string twice...so i just got confused with the irb-way to show the string. so i used gsub(/, ) and it worked. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

[Rails] gsub

2012-03-23 Thread Aaron Schmitz
hi, im getting tired on this one. i want to replace all forwardslashes with backwardslashes. irb: r = C:/RAILS/ r.gsub(/, \\) or r.gsub(/) {('\'} both give me: C:\\RAILS\\ how can i use gsub to display only one \? regards -- You received this message because you are subscribed to the Google

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 10:36, Aaron Schmitz a.schmitz...@googlemail.com wrote: hi, im getting tired on this one. i want to replace all forwardslashes with backwardslashes. irb: r = C:/RAILS/ r.gsub(/, \\) or r.gsub(/) {('\'} both give me: C:\\RAILS\\ how can i use gsub to display only one \?

Re: [Rails] gsub

2012-03-23 Thread Aaron Schmitz
thank younever thought about that.. next question! :D when i put in mit shell : i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg it works. but when i do *system(i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg)* it doesn't work. what am i doing wrong?i guess it is escaping

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 12:49, Aaron Schmitz a.schmitz...@googlemail.com wrote: next question! :D system(i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg) doesn't work. What happens when you try: system(i_view32.exe C:\\Rails\\test.png /convert=C:\\Rails\\test.jpg) ? -- You received this

Re: [Rails] gsub

2012-03-23 Thread Aaron Schmitz
= nil i can start calc.exe from firefox via the controller that says * system(calc.exe)*. but i cannot start i_view32.exe or firefox.exe etc. is it a permission issue on win xp? the command is ok, i tested it in cmd.exe -- You received this message because you are subscribed to the Google

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 13:46, Aaron Schmitz a.schmitz...@googlemail.com wrote: is it a permission issue on win xp? the command is ok, i tested it in cmd.exe Probably... I recommend a nice Linux install (even just a VM... ;-) -- You received this message because you are subscribed to the Google

Re: [Rails] gsub

2012-03-23 Thread 欧阳东晖
Does *system('i_view32.exe', 'C:\\Rails\\test.png', '/convert=C:\\Rails\\test.jpg')* work for you? On Fri, Mar 23, 2012 at 8:49 PM, Aaron Schmitz a.schmitz...@googlemail.comwrote: thank younever thought about that.. next question! :D when i put in mit shell : i_view32.exe

[Rails] gsub help

2010-06-09 Thread anon_comp
Here's my code def index file = BLAH-ex201588.doc @file_cut = order.gsub(/[\w [- ! # $ % ^ * = +]+]+\.doc$/, '*.doc) end The code worked before when I was using Ruby 1.9.1, but now I'm using Ruby 1.8.7 due to technical reasons. I would imagine that it should still work, but I doesn't.

Re: [Rails] gsub help

2010-06-09 Thread Amala Singh
I think you should ask this in a Ruby forum. My one cent. On 9 June 2010 14:37, anon_comp neocools...@gmail.com wrote: Here's my code def index file = BLAH-ex201588.doc @file_cut = order.gsub(/[\w [- ! # $ % ^ * = +]+]+\.doc$/, '*.doc) end The code worked before when I was using

[Rails] gsub fail

2010-02-22 Thread Chris Kalaboukis
Hi guys: I'm trying go through a table, read a field, escape out all the single quotes in there, and write it back again. For some reason my gsub, even though by all accounts looks right, doesn't seem to be working. Here is my code: ... y.text.gsub(',') thesql = text = '+y.text+'

[Rails] GSUB

2008-12-24 Thread Jayakumar Manickam
hi , I have a string with \. how can i gsub the string? i tried \.gsub('\','') but it is giving error. thanks in advance JK -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google