This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What is meant by [^a-zA-Z] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is meant by [^a-zA-Z]" Watch "What is meant by [^a-zA-Z]" New topic

What is meant by [^a-zA-Z]

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Hi... friends

I come with the [^a-zA-Z] pattern especially in searching.
Can i know what is that and how JVM compiler deals with it.
David Newton

Joined: Sep 29, 2008
Posts: 12617

Have you checked out any Java regex tutorials/documentation? There's quite a lot available on the web, and it would answer your question very quickly.
Henry Wong

Joined: Sep 28, 2004
Posts: 18765

If you look again, you will see the syntax is not a java syntax, but part of a string that is passed to the regex engine.

I recommend starting with a tutorial on regular expressions....


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Rajeev Trikha
Ranch Hand

Joined: Jan 29, 2010
Posts: 85
It is worth spending time on learning about regular expressions as they would become indispensable part of your toolset. The shorthand you have shown just means 'not an alphabetic character' but dig deep it is worthwhile.

Rajeev Trikha (SCJP 6)
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38519
Agree with Henry about tutorials; here is another good one, in the Java™ Tutorials
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: What is meant by [^a-zA-Z]