Why isn’t this regex working for the string “Array a”?
let mutable line = "Array a"
let regexIdentifier = new Regex("^[a-zA-Z_][a-zA-Z0-9_]*$")
line <- regexIdentifier.Replace(line, "\r\n$&\r\n") //KEYWORDS separation
Console.WriteLine(line)
(I want the program to separate both “Array” and “a” to different lines)
This pattern separate the “Array a” in two distinct matches
works also for a string like
\blimits the pattern at the word boundaries. (this gives backtwo Matches for the input text also if you have more than one space between)