可能在这里遗漏了一些简单的东西,但仍然在摸不着为什么我找到的物品清单总是空着。
client.Headers.Add("Cookie", "s_vi=[CS]v1|2A5F47608507C765-60000113A0063157[CE]; s_pers=%20s_vnum%3D1424366552113%2526vn%253D1%7C1424366552113%3B%20v44%3D%255B%255B%2527Direct%252520Load%2527%252C%25271421774552126%2527%255D%255D%7C1579540952126%3B%20s_pv%3Den_us%2520%253A%2520worldwide%2520%253A%2520global%2520landing%7C1421776386528%3B%20s_invisit%3Dtrue%7C1421776386530%3B%20s_lv%3D1421774586533%7C1516382586533%3B%20s_lv_s%3DFirst%2520Visit%7C1421776386533%3B%20s_cmc%3D1%7C1421776386540%3B%20s_nr%3D1426866016133-Repeat%7C1429458016133%3B%20s_fid%3D60E97348782318BD-305C723745392699%7C1490024416207%3B%20gpv_pn%3Ddivision%2520%253A%2520waterloo%2520works%2520%253A%2520home%7C1426867816209%3B; s_fid=22E0F07165D84047-07AD087FC8A8DC6F; s_nr=1477321997125-Repeat; SMSESSION=pSsBIy3Y/TvnON1g5zaFiMH5ZMLDyV2oOo8CKm9LeNiEOzl6WNjRfYDqEUkkimcpZ7VPVBSy/79IvtMWJwbDE0OTIjVFPFnBZImSLSeyMYNlDLtubzbAjJPDFsRs0tBGVsQyAKgUSGsfAXdNF5/bdCA17IYBgOaKTtrG2lSiDLkohvWilTxzAgC8MiW2RSkH/qyjmBfKzkoM2SA/1VYSkQRuCIFayc6x1aY7a7itZwHx1BnP5w98YenXIcYxkzXJjlboiINwh/C4zY2reReKMtzEvB5htc+L4kE9UoDoQkI3TP0Y9+Onz2aMa0V/mlbDrUyzpr/UADQwapzkinjvYIH6H/oG+3zM5pyryxNj8KMkqBIjcl8Gxdzmxs/pZZ0mKOh88VRbrYglxAXJbkevHZZDfb4gI6oAnlEEx0kQH9XyTjw0vK+f3qk3oqmXHg9X4aB+BHPjQVhYfCVyZ8YvlyXAAP2keJDoDED0f7MH70sQ2NLFSEXbv7Nt0dhsgCnur0RR2ZBqLjJmoEyDGNQ1DoxdLiJzQN3NBGFyOkELs0W6U1SbNZ2UudeQhg2NCmn161vwhoOBj5FdKj3+wzzoaRaG9zniHKfJDbaXIa5NKZtDkx7k059wn/XW+VbeqdvpVhQJIw/P7AsKc0EKznkuWCH2UXclUZyXT+V1HKvdeD1G6ouJzhHtmNx/FgyKGt+jzPXTT3TaHIQKE3/c6YwFAsHDOsC0dJQdxPeqEMrHe4zqA4VJzSN5wA2HNfr3vDVqOG0Tiv9afpwBmhwmA/v9CYG82Px7WzB1sBH5h7M3Igvq1NZtEHBxMV/S8joM8bhfnIudVpgui1TB8B0tciqHzBYKDQc3RUTe8bJdzmuffzT27LLprKGPjjqjaTUdluYCrSaH+AEvWFdtyfOoUJNGYBk3eB4Cl3HlezSkxGBXEYrHcTuWIhwLHdFDEOHbDW9yNY+zkPoS1QXpdaIxpFX3WTY4Ju6Fzy1Lui8MsPKKMJVd6wgnaKR0wITxEY8c6Kle3ObCuudpr0kAy5UsXlRkdTb9t2kLaEgLz03bzVi7WTSUTnMkYlFQ0OmXluUacU5mjKZP5EUX4iEBkDQkkxI851f3LrBL7pLt; gpv_pn=division%20%3A%20waterloo%20works%20%3A%20home; s_cc=true");
在此示例中,如果您查看const words = ['apps', 'apples', 'bands', 'bannanas', 'cards', 'cantaloupes'];
const str = 'app';
const re = new RegExp(str, 'gi');
function partial(element) {
console.log('partial', element, re.test(element))
return re.test(element)
}
const found = words.filter(partial);
console.log(found); // []?
的日志,则会看到两个单词' apps'和'苹果'返回true,所以AFAIK,partial
中的结果应为found
,对吧?
这里也是fiddle。