From: Timothy Hunter Date: 2005-07-13T09:30:50+09:00 Subject: Re: Another regular expression question tuyet.ctn@mscibarra.com wrote: > I have a select box that contains two items that are similar: > 1) GICS Sector > 2) Sector > > How do tweak this command to select the second item "Sector" instead of > "GICS Sector"? > > irb(main):065:0> ie.frame("customizeRemoteContent").select_list(:id, > "availableColumnsSelectBox").select(/Sector/) > > This selects "GICS Sector" > > I have tried select([Sector]) and other permutations but can't seem to > find the right one. I did go to this site to read up more about > regular expression, but the examples are not very clear. Appreciate > your suggestions! > http://www.ruby-doc.org/docs/ProgrammingRuby/html/intro.html#S5 > Look for "anchors". The sequence "\A" matches the beginning of a string, so the regular expression /\ASector/ will match only strings that start with "Sector". Similarly "\z" matches the end of a string.