Write a regular expression that will match texts like “Hello {X}” and only output “{X}” (w/o quotes).
If a match is not possible, the output should be empty.
The input will contain a single line of string with at most 20 characters.
If the input matches “Hello {X}”, then print “{X}” (w/o quotes). Otherwise leave the output empty.
Input | Output |
---|---|
Hello Regexp | Regexp |
Input | Output |
---|---|
Nyan Cat |