Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Paulo Marcel Coelho Aragão
On Tue, Jul 10, 2018 at 10:50:05AM -0400, Chet Ramey wrote: >> […] However, this indicates to me that bash recognizes \< \> as word >> anchors: > No, it doesn't. It indicates that the system's POSIX regular expression > implementation has extensions. >> 3. bash evaluates them correctly when used

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Chet Ramey
On 7/10/18 9:02 AM, Paulo Marcel Coelho Aragão wrote: > On Tue, Jul 10, 2018 at 08:27:18AM -0400, Greg Wooledge wrote: >> Bash uses ERE (Extended Regular Expressions) here. There is no \< or \> >> in an ERE. >> >> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04 >

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Chet Ramey
On 7/10/18 8:52 AM, Ilkka Virta wrote: > On 10.7. 15:27, Greg Wooledge wrote: >> On Mon, Jul 09, 2018 at 10:46:13PM -0300, marcelpa...@gmail.com wrote: >>> Word boundary anchors \< and \> are not parsed correctly on the right >>> side of a =~ regex match expression. >> >> Bash uses ERE (Extended Re

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Chet Ramey
On 7/9/18 9:46 PM, marcelpa...@gmail.com wrote: > Bash Version: 4.4 > Patch Level: 19 > Release Status: release > > Description: > Word boundary anchors \< and \> are not parsed correctly on the right side of > a =~ regex match expression. Bash assumes Posix regular expressions (EREs), and tho

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Paulo Marcel Coelho Aragão
On Tue, Jul 10, 2018 at 09:09:06AM -0400, Greg Wooledge wrote: > In this context, the backslashes serve only to "quote" the less-than > and greater-than signs. It's just like writing > > [[ 'foo bar' =~ "<"foo">" ]] You're absolutely right ! I wasn't looking at it from this angle, but yes, \ i

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Greg Wooledge
On Tue, Jul 10, 2018 at 10:02:34AM -0300, Paulo Marcel Coelho Aragão wrote: > It baffles me that literal \< \> are not evaluated correctly > > paulo:~$ [[ 'foo bar' =~ \ ]] && echo yes || echo no > no In this context, the backslashes serve only to "quote" the less-than and greater-than si

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Paulo Marcel Coelho Aragão
On Tue, Jul 10, 2018 at 08:27:18AM -0400, Greg Wooledge wrote: > Bash uses ERE (Extended Regular Expressions) here. There is no \< or \> > in an ERE. > > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04 Thanks for the reference. The document lists only ^ and $ as

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Ilkka Virta
On 10.7. 15:27, Greg Wooledge wrote: On Mon, Jul 09, 2018 at 10:46:13PM -0300, marcelpa...@gmail.com wrote: Word boundary anchors \< and \> are not parsed correctly on the right side of a =~ regex match expression. Bash uses ERE (Extended Regular Expressions) here. There is no \< or \> in an

Re: Word boundary anchors \< and \> not parsed correctly on the right side of =~

2018-07-10 Thread Greg Wooledge
On Mon, Jul 09, 2018 at 10:46:13PM -0300, marcelpa...@gmail.com wrote: > Word boundary anchors \< and \> are not parsed correctly on the right side of > a =~ regex match expression. Bash uses ERE (Extended Regular Expressions) here. There is no \< or \> in an ERE. http://pubs.opengroup.org/onl