Regular expressions are greedy -- they match the longest match they can. So this matches the first #| and the last |#. If you either replace the .* with say, [^|]* (this will prevent comments from including the | character) or use a non-greedy match (see the docs for this).
N. On Wed, Nov 17, 2010 at 11:11 AM, 김태윤 <[email protected]> wrote: > hello~ > I am making comment removing function > but > when str contains > #| comment 1 |# > (define values1 1) > #| comment 2 |# > (define values2 2) > #| comment 3 |# > the following code delete all of my str > (regexp-replace* "\\#\\|(.*)\\|\\#" str " ") > could somebody let me know how to remove only these comments ? _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

