I have a C# regular expression to match author names in a text document that is written as:
"author":"AUTHOR'S NAME"
The regex is as follows:
new Regex("\"author\":\"[A-Za-z0-9]*\\s?[A-Za-z0-9]*")
This returns "author":"AUTHOR'S NAME. However, I don't want the quotation marks or the word Author before. I just want the name.
Could anyone help me get the expected value please?
'inO'Connorand it only allows for exactly one space, no hyphens, no foreign characters etc. I don't know your usecase, but if you know the author name is going to be enclosed within the quotes, you would get away with just accepting anything that isn't a double quotes:\"author\":\"([^\"]+)\".