m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs \` and \' not supported?


From: Ice Ninja
Subject: Re: emacs \` and \' not supported?
Date: Sun, 5 Jul 2020 11:36:45 -0400

I found the issue. '.' does not match the new line.

so the following works well.
$ echo 'changequote([,])patsubst(good[]
bad,\`\(.\|
\)*'\\\'',a\&b)'|m4
agood
badb

On Sun, Jul 5, 2020 at 11:06 AM Ice Ninja <aeron.e.wang@gmail.com> wrote:
According to  https://www.gnu.org/software/findutils/manual/html_node/find_html/emacs-regular-_expression_-syntax.html

GNU extensions are supported:

  1. \w’ matches a character within a word
  2. \W’ matches a character which is not within a word
  3. \<’ matches the beginning of a word
  4. \>’ matches the end of a word
  5. \b’ matches a word boundary
  6. \B’ matches characters which are not a word boundary
  7. \`’ matches the beginning of the whole input
  8. \'’ matches the end of the whole input
However if I try using \` and \' in patsubst, it fails to find the match.

$ echo 'changequote()changequote([,])debugmode()traceon[]patsubst(good[]
bad,\`.*'\\\'',a\&b)'|m4
m4trace: -1- patsubst([good
bad], [\`.*\'], [a\&b]) -> [good
bad]
good
bad

\< \> seems to be supported.
$ echo 'changequote()changequote([,])debugmode()traceon[]patsubst(good[]
bad,\<.*\>,a\&b)'|m4
m4trace: -1- patsubst([good
bad], [\<.*\>], [a\&b]) -> [agoodb
abadb]
agoodb
abadb

$ m4 --version
m4 (GNU M4) 1.4.18
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Rene' Seindal.
$ cat /etc/redhat-release
Fedora release 26 (Twenty Six)

Thanks


reply via email to

[Prev in Thread] Current Thread [Next in Thread]