The defendant, Jonathon Michael Simpson, was sentenced yesterday, Thursday, 13th October, at Derry Crown Court, sitting in Coleraine.
He will serve 18 months in custody, and the remainder on licence.
At 3.10pm on Friday, January 21, police received a report that a woman was sitting in her car when Simpson approached her vehicle, opened the driver’s side door where she sat and told her to get out before attempting to pull her from the vehicle.
Simpson also punched her and tried to take her mobile phone. The woman fought him off and he ran from the scene.
Within 15 minutes, Response Team officers located Simpson on Bishop Street in the city centre and arrested him.
Detective Sergeant Ballentine said: “This was an appalling attack.
“The victim was sitting in her car, minding her own business, when she was subjected a nasty and disgusting attack from out of nowhere.
“You can only imagine the fear she felt during the attack and the resulting trauma from what happened.
“She is recovering well after this horrible ordeal and I want to acknowledge her bravery throughout the course of our investigation.
“Thank you also to the members of public who assisted with our investigation, and to our officers who responded quickly and arrested Simpson.
“I want to take this opportunity to reiterate the importance of calling police when you see something untoward happening because the faster we receive information, the faster we can act.”
The number to call is 101 and 999 in an emergency.