Files
codeql/cpp/ql/test/library-tests/regex/RegExpConfig.qll
copilot-swe-agent[bot] 6e4ac3915d Address code review: remove ECMAScript-incompatible comment groups, fix comments
- Remove `(?#...)` comment group support from ParseRegExp.qll (not in ECMAScript)
  - Remove `commentGroupStart` predicate
  - Remove `#` from `nonCapturingGroupStart` character list
  - Remove `commentGroupStart` call from `groupStart`
- Fix misleading comment in test.cpp line 64
- Clarify RegExpConfig.qll documentation to accurately describe `any()` behavior
2026-07-21 09:07:28 +00:00

20 lines
699 B
Plaintext

/**
* Test-only characterization: treats every C++ `StringLiteral` as a regular
* expression so that the test corpus in `test.cpp` populates `RegExp` without
* requiring a dataflow-based characterization.
*
* A production flow-config PR will narrow this to string literals that are
* actually passed to `std::regex` / `std::basic_regex`.
*/
private import semmle.code.cpp.regex.internal.ParseRegExp
/**
* Treats every `StringLiteral` as a `RegExp` for testing purposes.
* Production code should restrict this to literals that are actually used as
* regular expressions (e.g. passed to `std::regex`).
*/
class StdRegexStringLiteral extends RegExp {
StdRegexStringLiteral() { any() }
}