Results 1 to 3 of 3
  1. #1
    Nosrettap is offline Member
    Join Date
    Jan 2011
    Posts
    13
    Rep Power
    0

    Default What does the following expression mean "\\+"

    What does the following expression mean "\\+" ? It's either a normal expression or a regular expression...thanks

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    8

    Default

    Regular expression quantifier (Quantifiers (The Java™ Tutorials > Essential Classes > Regular Expressions)), typically meaning one or more times of the previous character, char class, etc...

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,044
    Blog Entries
    7
    Rep Power
    23

    Default

    Quote Originally Posted by doWhile View Post
    Regular expression quantifier (Quantifiers (The Java™ Tutorials > Essential Classes > Regular Expressions)), typically meaning one or more times of the previous character, char class, etc...
    Yep, but not here because the plus sign has been escaped; two backslashes are used because \+ doesn't make sense to javac (the Java compiler), i.e. the backslash itself needs to be escaped as well: \\+

    Javac will pass \\+ as \+ to the regular expression compiler; it will use the backslash to escape the plus sign resulting in an ordinary character + without any special meaning to the regular expression engine.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. "illegal start of expression"
    By 3RDofApril in forum AWT / Swing
    Replies: 2
    Last Post: 11-04-2010, 02:39 AM
  2. Replies: 3
    Last Post: 10-12-2010, 04:21 PM
  3. Replies: 1
    Last Post: 01-21-2010, 10:20 AM
  4. Replies: 2
    Last Post: 01-24-2009, 07:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •