using grep to find one match per line
Eh. N-
How do you want to 'stop' grep? In JS, calling
findGrep()
returns immediately, with the result of the search. That result is an array of found items, and the number of items indicate the number of occurrences found (0, 1, or more). There is nothing to stop.
You could use just the first found match of the results array in your script (I presume you need it for a certain 'use').
|