[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: 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

Re:  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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.