Welcome to the Treehouse Community
Looking to learn something new?
What did i do wrong?
where m i getting it wrong the last name is showing as last name and lastname showing as first name. my code is attached.
firstname must be PERROTO and last name must be Pier Giorgio
import re string = 'Perotto, Pier Giorgio' names = re.match(r''' ([-\w]+,) (\s[-\w\s\w]+) ''', string, re.X)
Steven Parker216,057 Points
If you look carefully at the error response it contains clues: Bummer! Didn't get the right content in the groups. Last name was "Perotto,", first name was " Pier Giorgio".
The last name contains a comma at the end, and the first name has a space at the beginning. These characters separate the names, but the regex should not include them as part of the names.