From: Rodrigo Bermejo Date: 2007-01-16T05:15:37+09:00 Subject: Re: regex: \ not in gsub? Shea Martin wrote: > I often use \< and \> to denote the start and end of word. But they > don't seem to work with gsub. Am I missing something? > > I would expect the following: > "xword1 word2 tword3".gsub( /\ > to return "xword1 XXXX2 tword3", but instead it the string unchanged. > > If the \< and \> are not supported, is there an alternative that ruby > provides? Thanks. > > Thanks, > > ~S "xword1 word2 tword3".gsub( /\bword/, 'XXXX' ) $rm rm -- Posted via http://www.ruby-forum.com/.