Then why not remove that line so it doesn't do that? If you want to know if the value was found, count how many times it is found...then at the end of reading of that count is zero print out that no...
Type: Posts; User: copeg
Then why not remove that line so it doesn't do that? If you want to know if the value was found, count how many times it is found...then at the end of reading of that count is zero print out that no...
Newbie is correct....sure the break works, breaks in the sense that it prevents reading the rest of the file if a hit is not found on the first line of said file. Enter in a regex that is not found...
Doh...kudos to newbie for pointing that out (serves me right for glancing over the code so quickly)
Not sure I understand. You say "this is the output"...do you mean this is the expected output?
SSCCE's are wonderful things...take this for example. Took less than a minute and shows what you are...
Please define a user input and line you would expect to match which doesn't...or better yet, post an SSCCE where the problem is clearly demonstrated. Nothing looks conspicuous in your code