[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Why is \/ invalid in a regular expression?
- From: Amelia A Lewis <amyzing@talsever.com>
- To: Roger L Costello <costello@mitre.org>
- Date: Tue, 20 Apr 2021 16:09:42 -0400
On Tue, 20 Apr 2021 18:46:11 +0000, Roger L Costello wrote:
> Why is \/ invalid? I have no idea. Anyone know why?
Because it has the syntax of an escape, but '/' is not a defined escape
character (or: "/ is not a valid second character in an escape sequence
starting with \").
To avoid the problem, use '\\/'. This should give the result that you
hope for.
'\' alone is the first character of an escape sequence. The escape
sequence '\\' means 'the character \'.
Note that, depending upon context, it sometimes becomes necessary to
escape things multiple times. This can happen, for example, if your
Java code needs to embed an XML Schema regular expression.
Amy!
--
Amelia A. Lewis amyzing {at} talsever.com
What's the end of a story? When you begin telling it.
-- Ursula K. Le Guin
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]