Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regex

 
Rishabh Shah
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is features in 7 version of regex. How to use it in jsp or any class for validation as i want regex which must have alphabets and space(optional). how to make it ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's anything new in Java 7 specifically about regexps. What, exactly, about you referring to? Or are you saying that you are using Java 7, and are struggling with its regexp features? If so, start here: http://download.oracle.com/javase/tutorial/essential/regex/
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regex support through the java.util.regex package has been available since Java 1.4. Java 5.0 added a few features (quoting being the most important), Java 7 only added constant Pattern.UNICODE_CHARACTER_CLASS.
 
Rishabh Shah
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok...Thanks
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Regex support through the java.util.regex package has been available since Java 1.4. Java 5.0 added a few features (quoting being the most important), Java 7 only added constant Pattern.UNICODE_CHARACTER_CLASS.

Java 7 also added named regex groups.
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No wonder I missed it - the Javadoc page is missing the "since 1.7" tag.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed. Also the Matcher class is missing that tag.
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bad Oracle. BAD Oracle!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic