summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/generic/apt/matching/pattern.cc4
-rw-r--r--src/generic/apt/matching/pattern.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/generic/apt/matching/pattern.cc b/src/generic/apt/matching/pattern.cc
index 5743a2a7..75339e1d 100644
--- a/src/generic/apt/matching/pattern.cc
+++ b/src/generic/apt/matching/pattern.cc
@@ -79,7 +79,9 @@ namespace aptitude
bool is_pattern(const std::string &s)
{
- return s.find_first_of("~?") != s.npos;
+ // regex characters are ".?+*|[^$"
+ // pattern characters are "~?"
+ return s.find_first_of("~?.?+*|[^$") != s.npos;
}
}
}
diff --git a/src/generic/apt/matching/pattern.h b/src/generic/apt/matching/pattern.h
index 5aad42f8..96d48550 100644
--- a/src/generic/apt/matching/pattern.h
+++ b/src/generic/apt/matching/pattern.h
@@ -2021,8 +2021,8 @@ namespace aptitude
* This is used in situations where it would be counterintuitive
* for all strings to be treated as search patterns, but where we
* want search patterns to be available. Strings are considered
- * to be seach patterns if they contain a tilde (~) or a question
- * mark (?).
+ * to be seach patterns if they contain a tilde (~), a question
+ * mark (?), or any regex characters (.?+*|[^$).
*
* \return \b true if the string qualifies as a search pattern.
*/