search for: rubular

Displaying 7 results from an estimated 7 matches for "rubular".

2011 Aug 12
8
Need some help with regular expression
I need to validate a string from a user (a location for use with geotagging) that is. I want to make sure that the user specify a city and a country in my inp ... So i wrote this => validates :usri_location, :presence => true, :format => {:with => /^[a-zA-Z]+{\,\s}+[a-zA-Z]/i}, :on => :create I want to make sure that the user writes city,
2012 Sep 30
3
How to escape a forward slash with gsub, also does interpolation work with gsub?
I am trying this: I want to replace all the text in between java comments: /* start */ replace this text here /* end */ I''m trying: text.gsub(//* start */(.*)/* end *//im, replace_with) But i''m getting errors relating to expecting keyword_end. How should I be escaping /* and */ ? Also, does string interpolation work in gsub regex? Say I had variables like: start_tag =
2009 Jan 17
3
[Cucumber] Struggling with "multiple step definitions"
Hey gang, I find myself struggling with multiple step definitions in cucumber all the time. I regularly test the contents of my flash[:notice] in steps, since I think that''s part of the behaviour of the app. So, while implementing a new feature, I ran into the following error: /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.15/bin/../lib/cucumber/ step_mother.rb:81:in
2011 Aug 25
5
custom fact regex problem
Hi guys I have a custom fact envt, it was working fine but now I have to make some changes in it; puppet client''s hostname is of the type 1234qa-abc-de.local where 1234 can be any thing of any length.My custom fact should contain qa, ie I want to check in the first part(before the first -) of the hostname if there exists a pattern/word qa and if it exists then my custom fact for envt
2009 Jun 13
2
Help on Regular EXpression
hi i need to validate user input for my designation field . that field should accept(alphapets,numbers,-,&) example => System support - Trainee could u people help me with the reqular expression. Thanks for any helps -- Posted via http://www.ruby-forum.com/.
2009 Jul 06
0
Help with regular expression
...ubt? ------------------------------------------------------ We are thinking to solve this problem using regular expressions,we want to detect the urls and turn these into a links. With this regular expression: (\b(https?|ftp|file)\S+|\b(www?|ftp|file)\S+) I can detect the urls (Is checked in www.rubular.com great page to test our expressions). But i have a big problem, I only want to turn into a link the urls what there isn''t into <a href="www..." and <img source="www". These kind of urls must stay with no changes. Somebody can help me? I don''t know how...
2010 Sep 18
3
max-age/header problems with nginx
0 down vote favorite I notice that in my production enviornment (where I have memcached implemented) in see a cache-control - max-age header in firebug, anytime I am looking at an index page (posts for example). Cache-Control max-age=315360000 In my dev environment that header looks like following. Cache-Contro private, max-age=0, must-revalidate As far as I know I have not done anything