Re: Using StringReplace to replace a regex containing newlines
- To: mathgroup at smc.vnet.net
- Subject: [mg98221] Re: Using StringReplace to replace a regex containing newlines
- From: dh <dh at metrohm.com>
- Date: Fri, 3 Apr 2009 04:34:06 -0500 (EST)
- References: <email@example.com>
in Perl as well as Mathematica syntax, "." does not match newline.
Therefore you have to specify that it should match by e.g. by using(?s).
Here your example:
StringReplace[str,RegularExpression["BEGINIGNORE(?s).*ENDIGNORE"] -> ""]
hope thid helps, Daniel
> Check out the following question and answer:
> It seems to me that that's a bug in Mathematica's regular expression
Prev by Date:
Re: eliminate x
Next by Date:
Re: Update to Hinton Button/palette tutorial for Mathematica 7?
Previous by thread:
Using StringReplace to replace a regex containing newlines
Next by thread: