Given a string, I want to retrieve a string that is in between the quotation marks, and that is fully capitalized.
For example, if a string of
oqr”awr”q q”ASRQ” asd “qIKQWIR”
has been entered, the regex would only evaluate “ASRQ” as matching string.
What is the best way to approach this?
Edit: Forgot to mention the string takes a numeric input as well I.E: “IO8917AS” is a valid input
EDIT: If you actually want “one or more characters, and none of the characters is a lower-case letter” then you probably want:
That will then allow digits as well… and punctuation. If you want to allow digits and upper case letters but nothing else, you can use:
Or in verbatim string literal form (makes the quotes more confusing, but the backslashes less so):
Original answer (before digits were required)
Sounds like you just want (within the pattern)
So something like:
Or for full Unicode support, use the
LuUnicode character category:EDIT: As noted, if you don’t want to match an empty string in quotes (which is still “a string where everything is upper case”) then use
+instead of*, e.g.Short but complete example of finding and displaying the first match: