The widespread availability of large language models (LLMs) has encouraged many individuals to explore chatbot development for their business needs. However, creating chatbots for handling sensitive information, like in healthcare, can be challenging. Mistakes made by these bots when extracting information or providing health recommendations can have serious consequences. When developing a chatbot for pharmacy recommendations, it is essential for the bot to effectively extract symptom-related information and other relevant patient data and then offer recommendations for actions or medications based on that information. In this study, we proposed a straightforward and effective approach that combines regular expression templates for information extraction with forward chaining for inference to create a pharmacy recommendation chatbot called SmartFarma. In scenarios like pharmacy recommendations, we will demonstrate that the use of regular expression templates is sufficient and produces better results than some machine learning methods. Additionally, by using regular expressions, SmartFarma can be developed with transparent data handling, allowing experts to trace, monitor, and evaluate its recommendations. This research primarily focuses on the extraction of patient information. Our model, as proposed, achieved an impressive score of 81.54%, outperforming both the Biomedical Bidirectional Encoder Representations from Transformers (BERT) and Generative Pre-Trained Transformer (GPT) models.