Answers for "regex new line"

1

regex ignore newline

[sS]*
Posted by: Guest on February-26-2020
1

regex start line

// Match from the start of the line
^
//example:
let str = "HELLO hello world"
let reg = /hello/g //g option: doesn't stop at first match
str.match(reg) // Array(2)["HELLO", "hello"]
reg = /^hello/g //match hello at the start of the string
str.match(reg) // Array(1)["HELLO"]
Posted by: Guest on April-06-2020
0

javascript regex single line

//s Flag 
// replace . with [sS] ad ex.

/<!--(.*?)-->/gs ->>>>> /<!--([sS]*?)-->/g

//or

/<!--(.*?)-->/gs ->>>>> /<!--[sS]([sS]*?)[sS]-->/g
Posted by: Guest on April-06-2020

Browse Popular Code Answers by Language