XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Why is \/ invalid in a regular expression?

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS