From 3d42e48cd375109871d1867fdfce1ce6855da17d Mon Sep 17 00:00:00 2001 From: Dmitry Mikhirev Date: Sat, 15 Nov 2014 11:29:18 +0300 Subject: use E flag for pattern expansion It is better to reserve e flag for compatibility with Perl s///e. --- GNUmakefile | 2 +- README.md | 10 +++++----- pcre.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index fb71c7f..013ec80 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -16,7 +16,7 @@ check: $(tests) test001 = '$(m ^test$,test)' = test test002: var = es -test002 = '$(m ^t$(var)t$$,test,e)' = test +test002 = '$(m ^t$(var)t$$,test,E)' = test test003 = '$(m ^t(es)t$,test)$0$1' = testtestes -a -z '$(m a,b)$0$1' test%: diff --git a/README.md b/README.md index 8c5958b..a8cc309 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -make\_pcre is a plugin for GNU make providing ability to use perl compatible +make\_pcre is a plugin for GNU make providing ability to use Perl compatible regular expressions. It requires make 4.0 or higher (tested with 4.1) and libpcre3 (tested with 8.30). @@ -27,7 +27,7 @@ to run self-tests. Install ------- -Copy pcre.so into the directory where your makefile is stored. +Copy `pcre.so` into the directory where your makefile is stored. Usage ===== @@ -64,12 +64,12 @@ Options `pcre_find` can take optional third argument consisting of one ore more characters, each of which enables some option: - $(pcre_find PATTERN,IN,emsuUxX8) - $(m PATTERN,IN,emsuUxX8) + $(pcre_find PATTERN,IN,EmsuUxX8) + $(m PATTERN,IN,EmsuUxX8) The following options are implemented: -- `e` enables expansion of pattern before compilation. Note that you will need +- `E` enables expansion of pattern before compilation. Note that you will need to use `$$` instead `$` for matching end of line in this case; - `m` makes regexp treating string as multi-line, i. e. `^` and `$` will match immediately after or immediately before internal newlines. The same diff --git a/pcre.c b/pcre.c index ec922b2..9b5ab51 100644 --- a/pcre.c +++ b/pcre.c @@ -45,7 +45,7 @@ char *match(const char *name, int argc, char **argv) if (argc > 2) { for (p = argv[2]; *p != '\0'; p++) { switch (*p) { - case 'e': + case 'E': pat = gmk_expand(argv[0]); break; case 'm': -- cgit v1.2.1