Python Forum
Using regex to count specific character in file - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Using regex to count specific character in file (/thread-35124.html)



Using regex to count specific character in file - shamishd - Oct-01-2021

Using regex to count specific character in file

i have a hard time getting the right output using regex to count "$" on the file

#content in sample1.txt
i have $100 in my bank acc now
i made $20 lastnight

#desired output in sample2.txt
$ found in file: 2


RE: Using regex to count specific character in file - snippsat - Oct-01-2021

show what you have tried.