I'm trying to match the content of a string up to the occurrence of a double space (ignoring the case when the double space is after the autor/name identifier) or any other character different than A-Z or a single blank space, until the moment I came up with the following regular expression, although the \S does match anything except a blank space.
(AUTOR|NAME):?([A-Z ]\S)+
AUTOR: LEANDRO LUCIANI TAVARES -- This should match up to 'AUTOR: LEANDRO LUCIANI'
AUTOR LEANDRO LUCIANI \TAVARES -- This should match up to 'AUTOR LEANDRO LUCIANI' discarding anything after the backslash
AUTOR LEANDRO TAVARES -- This should match up to 'AUTOR LEANDRO TAVARES'
Edit:
I am trying to run it on C# so it must be compatible with the .NET implementation of regular expressions.
Thanks in advance, Leandro Tavares
What you are looking for is probably something like that:
(AUTOR|NAME)[\s:]\s*([A-Z]+( [A-Z]+)*)
This PCRE works for me:
/(AUTOR|NAME):?\s*([A-Z ]+?)(?: | \\|\\|$)/
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