[plt-scheme] regexp-match a full line

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Oct 6 21:06:13 EDT 2008

On Oct  6, Eli Nistal wrote:
> How do I pull an entire line from a file that contains the regular
> expression I am looking for e.g. like grep? regexp-match* pulls all
> the instances of a regular expression from an open file. How can I
> get regexp-match to pull the whole line?

Sounds like you want use the "multi-mode" regexp.  For example:

  (regexp-match #rx"(?m:.*some pattern.*)"
                (open-input-file "some-file"))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.