On Jan 13, 4:25 ¨Βν¬ ΚυξλοξΌκυξλο®®®ΐηναιμ®γονΎ χςοτεΊ > Hello > I have with great effort started on teh regex implemention and am > stuck at one point. > here is my code > (add)\s+\S+\s+[i|s|f]\s+[pei]?\s+ > > The string is as follows and the tokens are equavalent to > 1 token=Add > 2 token=any text > 3. token=one of the following i or s or f > 4.token= 0 or 1 of the following characters [p e i] > > I am stuck at the 4th token. ¨Β τθουηθαζτετθτολεχιμμ ηιφε > the 0 or 1 option. > pl correct me if i made a error > > seede irb(main):046:0> a=Regexp.new('(add)\s+(\S+)\s+([i|s|f])\s+([pei])?\s +',true) => /(add)\s+(\S+)\s+([i|s|f])\s+([pei])?\s+/i irb(main):047:0> a =~("Add comp i pe") => nil I dont get match at 4th token