The search-forward function takes four arguments:
(search-forward "target-string"
limit-of-search
what-to-do-if-search-fails
repeat-count)
The second argument (limit-of-search) bounds the search. it is specified as a position in the buffer. In this case, the search can go to the end of the buffer, so no bound is set and the second argument is nil.
How to set it to just search until the end of the current paragraph?