Python Forum

Full Version: Using regex to count specific character in file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
show what you have tried.