From: Adhal on 20 May 2010 06:37 > I meam what is the purpose of using a max of 3 here then ? > > //Tony I think you misunderstood how to use it. It means that if it finds any string that contains 1 to 3 "0" it should return match, but then it continues to search the rest of the string too see if there are any other matches. You have to specify that the next letter can't be an "o". And my previous post is wrong. It should be o{1,3}[^o]* and not [^o]o{1,3}[^o] as it's pointless. ^_^ The first [^o] is redundant. You add the "*" (zero or more times) at the end to specify that it doesn't have to have another character afterwards. -- Adhal
|
Pages: 1 Prev: why does this regular expression match Next: Solution using Expression tree |