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)
The whitespace in "Array a" isnt matched.
Better use a regexp like "^[\w_]+ [\w_]+$"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With