Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9928762 commit 4c25d84Copy full SHA for 4c25d84
1 file changed
javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches/tst.js
@@ -3,7 +3,7 @@ function optionalPrefix(x) {
3
}
4
5
function mandatoryPrefix(x) {
6
- return /^https:/.test(x); // NOT OK
+ return /^https:/.test(x); // OK
7
8
9
function httpOrHttps(x) {
@@ -65,3 +65,11 @@ function search2(x) {
65
function lookahead(x) {
66
return /(?!x)/.search(x); // OK
67
68
+
69
+function searchPrefix(x) {
70
+ return /^foo?/.search(x); // NOT OK - `foo?` does not affect the returned index
71
+}
72
73
+function searchSuffix(x) {
74
+ return /foo?$/.search(x); // OK - `foo?` affects the returned index
75
0 commit comments