regex reserved chars

L

Lew

I always confirm and follow all links that I post before I press SEND.
In addition I follow the search links, ensuring that the top three or
four contain information pertinent to the question. Often I will spend
some time reading the articles to which the search linked. I learn a
lot doing that.
You asked the question.

So what about you check!!!!

The first link I get has the info.

By offering a search link I'm able to provide much, much more information
to the querent than anything I could condense myself into a post.

Some people get mad, saying, "If I could have come up with those search
terms I wouldn't have asked!"

Exactly. But rather trivial, as that could be said about every question
that comes up here. But you took an important first step, seeking help
for your problem.

My skill at providing search terms that will help you find your answers
is my gift to you. You are most welcome.
 
N

Nigel Wade

Actually it does explain that the special characters are different
inside and outside.
...
It did not answer the next question: what is the special
characters inside.

I had to double-check this myself, but it does indeed answer the question. The section on character classes lists all
the special character classes; they even order them by precedence for you.

They are:

1. Literal escape: \
2. Grouping: []
3. Range: - (as in a-z)
4. Union (implicit): [a-e][i-o]
5. Intersection: &&

That's it.

Er, not quite. There's also '^' which, as the first character only, negates the match.

Under the section "Character classes":

[^abc] Any character except a, b, or c (negation)
 
M

markspace

Er, not quite. There's also '^' which, as the first character only,
negates the match.

Did you read the next paragraph where I mention this?
(It appears to me that
^ actually makes a separate token with [, [^, which is different from
the non-negated character class. That's why you can use ^ anywhere
within the character class except the first position.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

video cards for Java 1
ctrl-c ctril-v 14
StringBuilder for byte[] 11
abbreviated generic syntax 14
probing SSL websites 1
creating byte[] with subfields 14
jdk 1.7.0_13 is out 4
slick progress bar 5

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top