The moose likes Java in General and the fly likes Regular Expresion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Regular Expresion" Watch "Regular Expresion" New topic

Regular Expresion

Naresh Rajan
Ranch Hand

Joined: Sep 08, 2005
Posts: 45
I am trying to match a string which can contain any digit except 6 as the first charecter. Can anyone please let me know how I do it.


Am not a pro and thats why am here!!!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14991

Have you looked at the API documentation of class java.util.regex.Pattern? It explains how to make a Java regular expression.

What did you try out yourself and how did that work out?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Piet Verdriet
Ranch Hand

Joined: Feb 25, 2006
Posts: 266
Here's a demo:


Good luck.
I agree. Here's the link:
subject: Regular Expresion
It's not a secret anymore!