Not knowing the state of your environment or what you intend to do with the registered fact, I can only offer you this advice:
If a line in a file needs to exist and an action should occur if that file is changed, line in file is the most precise way to do this operation.
If you are using searches or other methods to find values in a file in order to notify actions, you haven't added additional precision to your plays. The risk of using regular expression is no different if you use line in file or if you use grep. There's some great regular expression builders on the web. Try using that to improve the precision of lineinfile, instead of querying system states using grep or other utilities.