Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Unicode, escape seq

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Why \\u "double escape character" invalid?
I miss this concern with regex where we require "\\d" instead of "\d", we need two "\\" before d.
Please guide me!

Thanks and Regards,
cmbhatt
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the grammar for a Unicode escape from the Java Language Specification.

UnicodeEscape:
\ UnicodeMarker HexDigit HexDigit HexDigit HexDigit

UnicodeMarker:
the letter you - this site won't let you put the letter by itself
UnicodeMarker u


So you don't want to start with two backslashes because that will mean the second backslash should be interpreted as just the backslash and not as part of the Unicode escape.

Also this grammar implies that you can repeated the Unicode marker.

That is, each of these seperately will compile.

,

and so on.
[ April 03, 2007: Message edited by: Keith Lynn ]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And boys, dont forget,
big farms need red tractors
\b \f \n \r \t
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Keith and Antonio!


Thanks and Regards,
cmbhatt
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic