Javascript Regex
The s flag allows . to match newline characters. src
String.match(regex_patter)nếu có capture group()thì sẽ return an arrayarr:arr[0] = entire matcharr[1] = first capture groupand so on.
.match by default will search with flag global & multi-line => This statement is not true. This is my wrong assumption!!
String.prototype.replace()- nếu regex input có
gflag thì replace all instance
- nếu regex input có
Template Literal
Trong javascript, template string, khi gõ enter thì nó sẽ insert newline character \n.
Tuy nhiên nếu gõ \e rồi enter liền sau đó thì nó sẽ không insert \n.
string = `\
hogehoge
`;