Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita120f70

Browse files
committed
fix regex examples
1 parentfc2d4d0 commita120f70

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎_posts/2016-01-07-test-examples.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,20 @@ it('should be {a: 42}', function () {
5757

5858
####regex
5959

60+
```js
61+
it('should include the variable "count"',function () {
62+
var regex=newRegExp('count');
63+
var string=target.toString();
64+
expect(string.match(regex)).to.be.true;
65+
});
66+
```
67+
6068
```js
6169
it('should access the property "prop"',function () {
6270
var regex1=/\.prop/;// dot notation
6371
var regex2=/\[["']prop["']\]/;// bracket notation
6472
var string=target.toString();
65-
var result=!!string.match(regex1)&&!!string.match(regex2);
73+
var result=!!string.match(regex1)||!!string.match(regex2);
6674
expect(result).to.be.true;
6775
});
6876
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp