The 23-year-old mother was walking with her child along Hercus Loan onto Market Street in Musselburgh, East Lothian when she spotted the suspect walking towards her.
As he passed, he exposed himself to her.
The incident happened at around 10.30am on Monday.
The suspect is described as a being white, mid 50s, 5ft 6in tall, large build, with a long unkempt greying beard.
He was wearing a dark coloured baseball cap, a royal blue two-tone jumper, and dirty jeans.
A police spokesman said: "While she was in no way harmed, the victim was understandably distressed as a result of this incident, particularly given that she was with her young daughter at the time.
"We are keen to speak to anyone who was in the Market Street area of Musselburgh at around the time of the incident, who may have noticed the suspect, to contact us immediately.
"Similarly, anyone who recognises his description, or has any other information that can help our inquiries should also get in touch.
"Anyone with any information should contact police on 0131 311 3131, or Crimestoppers in confidence and complete anonymity on 0800 555 111."