Pills to regulate

If your doctor puts you on medication to regulate your period .. and you get off it and it goes back to being regular can you still get pregnant ?