[Rails] Regex for string first chars - Model validation

2011-02-11 Thread Rodrigo Alves Vieira
Hello everyone, in my Rails app I need to validate a string that on creation can not have its first chars empty or composed by any special chars. For example: file and %file aren't valid. Do you know what Regex I should use? Thanks! -- You received this message because you are subscribed

Re: [Rails] Regex for string first chars - Model validation

2011-02-11 Thread kedar mhaswade
On Fri, Feb 11, 2011 at 11:30 AM, Rodrigo Alves Vieira rodrig...@gmail.comwrote: Hello everyone, in my Rails app I need to validate a string that on creation can not have its first chars empty or composed by any special chars. For example: file and %file aren't valid. Do you know what Regex

Re: [Rails] Regex for string first chars - Model validation

2011-02-11 Thread Philip Hallstrom
On Fri, Feb 11, 2011 at 11:30 AM, Rodrigo Alves Vieira rodrig...@gmail.com wrote: Hello everyone, in my Rails app I need to validate a string that on creation can not have its first chars empty or composed by any special chars. For example: file and %file aren't valid. Do you know what

Re: [Rails] Regex for string first chars - Model validation

2011-02-11 Thread Rodrigo Alves Vieira
Hello, thanks for the reply, but after applying this regex I go to rails console and run a = File.new a.file_name = example.txt It still works, when it shouldn't... any more help? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To

Re: [Rails] Regex for string first chars - Model validation

2011-02-11 Thread Rodrigo Alves Vieira
Undescore is allowed. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For

Re: [Rails] Regex for string first chars - Model validation

2011-02-11 Thread Rodrigo Alves Vieira
Underscore is allowed. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com.