Hello friends i need a regular expression which will check if the string contain the special character or not? and accordingly it should return true, false value. Thanks abhi --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Sep-27 11:43 UTC
Re: Regular expression to identity special character
On Sep 27, 12:36 pm, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello friends i need a regular expression which will check if the string > contain the special character or not? and accordingly it should return true, > false value. >Depends entirely on what you mean by special character? Fred> Thanks > abhi--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Abhishek shukla
2008-Sep-27 11:47 UTC
Re: Regular expression to identity special character
Hey Fred, Suppose i have a string "abcde fghi" it should gives true, and suppose if i have a string "abcd %$# fghi" it should return false. Thanks On Sat, Sep 27, 2008 at 5:13 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Sep 27, 12:36 pm, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello friends i need a regular expression which will check if the string > > contain the special character or not? and accordingly it should return > true, > > false value. > > > Depends entirely on what you mean by special character? > > Fred > > Thanks > > abhi > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Sep-27 12:41 UTC
Re: Regular expression to identity special character
That''s still not very precise. Do you mean anything that''s not a letter or a space? What about punctuation, numbers etc... ? You''re probably just going to end up with one of the builtin character classes like \w or custom ones like [a-z] Sent from my iPhone On 27 Sep 2008, at 12:47, "Abhishek shukla" <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey Fred, > Suppose i have a string "abcde fghi" it should gives true, and > suppose if i have a string "abcd %$# fghi" it should return false. > > Thanks > > On Sat, Sep 27, 2008 at 5:13 PM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > wrote: > > > > On Sep 27, 12:36 pm, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello friends i need a regular expression which will check if the > string > > contain the special character or not? and accordingly it should > return true, > > false value. > > > Depends entirely on what you mean by special character? > > Fred > > Thanks > > abhi > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Abhishek shukla
2008-Sep-27 14:05 UTC
Re: Regular expression to identity special character
yes basically i don''t want my string should contain any ''punctuation'' if so then it should return false. regards abhishek On Sat, Sep 27, 2008 at 6:11 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That''s still not very precise. Do you mean anything that''s not a letter or > a space? What about punctuation, numbers etc... ? You''re probably just going > to end up with one of the builtin character classes like \w or custom ones > like [a-z] > > Sent from my iPhone > > On 27 Sep 2008, at 12:47, "Abhishek shukla" <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hey Fred, > Suppose i have a string "abcde fghi" it should gives true, and suppose if i > have a string "abcd %$# fghi" it should return false. > > Thanks > > On Sat, Sep 27, 2008 at 5:13 PM, Frederick Cheung <<frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> >> >> On Sep 27, 12:36 pm, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hello friends i need a regular expression which will check if the string >> > contain the special character or not? and accordingly it should return >> true, >> > false value. >> > >> Depends entirely on what you mean by special character? >> >> Fred >> > Thanks >> > abhi >> >> > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Abhishek, Take a look on this article: http://marcricblog.blogspot.com/2008/08/bitwising-ruby.html More specifically, the last example. On that case I just consider words. You will need to adapt it to your needs. Regards. On Sep 27, 11:05 am, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> yes basically i don''t want my string should contain any ''punctuation'' if so > then it should return false. > regards > abhishek > > On Sat, Sep 27, 2008 at 6:11 PM, Frederick Cheung < > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > That''s still not very precise. Do you mean anything that''s not a letter or > > a space? What about punctuation, numbers etc... ? You''re probably just going > > to end up with one of the builtin character classes like \w or custom ones > > like [a-z] > > > Sent from my iPhone > > > On 27 Sep 2008, at 12:47, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hey Fred, > > Suppose i have a string "abcde fghi" it should gives true, and suppose if i > > have a string "abcd %$# fghi" it should return false. > > > Thanks > > > On Sat, Sep 27, 2008 at 5:13 PM, Frederick Cheung <<frederick.che...@gmail.com> > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> On Sep 27, 12:36 pm, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > Hello friends i need a regular expression which will check if the string > >> > contain the special character or not? and accordingly it should return > >> true, > >> > false value. > > >> Depends entirely on what you mean by special character? > > >> Fred > >> > Thanks > >> > abhi--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can use http://www.rubular.com/ to test and find the regex you need. On Sep 28, 2:08 pm, MarcRic <marc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Abhishek, > > Take a look on this article: > > http://marcricblog.blogspot.com/2008/08/bitwising-ruby.html > > More specifically, the last example. > > On that case I just consider words. You will need to adapt it to your > needs. > > Regards. > > On Sep 27, 11:05 am, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > yes basically i don''t want my string should contain any ''punctuation'' if so > > then it should return false. > > regards > > abhishek > > > On Sat, Sep 27, 2008 at 6:11 PM, Frederick Cheung < > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > That''s still not very precise. Do you mean anything that''s not a letter or > > > a space? What about punctuation, numbers etc... ? You''re probably just going > > > to end up with one of the builtin character classes like \w or custom ones > > > like [a-z] > > > > Sent from my iPhone > > > > On 27 Sep 2008, at 12:47, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hey Fred, > > > Suppose i have a string "abcde fghi" it should gives true, and suppose if i > > > have a string "abcd %$# fghi" it should return false. > > > > Thanks > > > > On Sat, Sep 27, 2008 at 5:13 PM, Frederick Cheung <<frederick.che...@gmail.com> > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >> On Sep 27, 12:36 pm, "Abhishek shukla" <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> > Hello friends i need a regular expression which will check if the string > > >> > contain the special character or not? and accordingly it should return > > >> true, > > >> > false value. > > > >> Depends entirely on what you mean by special character? > > > >> Fred > > >> > Thanks > > >> > abhi--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---