AP
Size: a a a
AP
B
ДП
'csrf_token=sCk1Y9LFpQvtmTMHQTjCPBxbKgcQZTLYdj3KBmUvJN4; path=/; secure'.match(/=(\w+);/g)
=;
?AP
ДП
ДП
S
'csrf_token=sCk1Y9LFpQvtmTMHQTjCPBxbKgcQZTLYdj3KBmUvJN4; path=/; secure'.match(/=(\w+);/g)
=;
?If the g flag is used, all results matching the complete regular expression will be returned, but capturing groups will not.так что стоит обойтись без
g
:if the g flag is not used, only the first complete match and its related capturing groups are returned. In this case, the returned item will have additional properties as described below.и взять второй элемент, который будет соответствовать группе захвата:
> 'csrf_token=sCk1Y9LFpQvtmTMHQTjCPBxbKgcQZTLYdj3KBmUvJN4; path=/; secure'.match(/=(\w+);/)
[
'=sCk1Y9LFpQvtmTMHQTjCPBxbKgcQZTLYdj3KBmUvJN4;',
'sCk1Y9LFpQvtmTMHQTjCPBxbKgcQZTLYdj3KBmUvJN4',
index: 10,
input: 'csrf_token=sCk1Y9LFpQvtmTMHQTjCPBxbKgcQZTLYdj3KBmUvJN4; path=/; secure',
groups: undefined
]
AP
S
NK
NK
VS
VS
ДП
DA
S
DA
AP
AP
ES