[racket] regexp-match to return a line containing a specified string...

From: Don Green (infodeveloperdon at gmail.com)
Date: Tue May 7 17:08:41 EDT 2013

Trying to use regexp-match to return a line containing a specified string...


 ;Create fn: find-string.ss.

;Given a file and a find-string.

;Returns a line-string with first find.

;The input file has a lot of lines.

;I am thinking it would be good to filter all but the line of interest,
giving me a one-line string to work with. For this reason, I am trying to
use regexp-match.


 (define find-string

(lambda (src-file find-string)

(define string-from-file (file->string (string->path src-file)))

;left off here.

))


 (find-string "test4.txt" "figure src=")


 Any suggestions are appreciated. Thanks

Don Green
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130507/7e3ae54b/attachment.html>

Posted on the users mailing list.