Results 1 to 8 of 8
Thread: Pattern.compile Help
- 04-11-2011, 03:08 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 29
- Rep Power
- 0
Pattern.compile Help
How can I enter multiple names in a TextField using Pattern.compile.
I tried with
The name that I want to enter is something like this:Java Code:public static final Pattern PATTERN_NAME=Pattern.compile("[A-Z]('[A-Z])?([a-z])+"); and public static final Pattern PATTERN_NAME=Pattern.compile("(\\b([A-Z])([a-z])+([ -])?)+");
John 'oryley george Lasló abu-MOHAMED
random charachers as you can see from the example
- 04-12-2011, 10:09 AM #2
hi
you can read that
Pattern (Java 2 Platform SE v1.4.2)
i hope benefit
GOOD LUCK
please help hisLast edited by leen; 04-12-2011 at 10:13 AM.
I did not understand anything in Java:(
Therefore, future lost:eek:
- 04-12-2011, 10:25 AM #3
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Im confused why you need to use pattern for this? Do you want to only allow certain characters to show up? Have the text field contain some initial value? Please let me know what you are trying to do.
- 04-13-2011, 06:17 AM #4
Member
- Join Date
- Dec 2009
- Posts
- 29
- Rep Power
- 0
- 04-13-2011, 07:31 AM #5
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
I don't really understand what you want still. Did you read the link provided by leen?
You want to have the Text field contain a name when the GUI is created?
Do you want the user to type in a name? What do you want to happen as they type.
- 04-13-2011, 09:03 AM #6
Member
- Join Date
- Dec 2009
- Posts
- 29
- Rep Power
- 0
Yes! I want the user type names.
- 04-13-2011, 09:42 AM #7
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Ok, why do you need a pattern? Why can't they just type there name in?
- 04-14-2011, 02:31 PM #8
Member
- Join Date
- Dec 2009
- Posts
- 29
- Rep Power
- 0
Here is part of the program were I use pattern.Java Code:package proiect_final; import java.awt.Dimension; import java.awt.Toolkit; import java.util.regex.Pattern; public class Constante { public static final Dimension DIMENSIUNE_ECRAN=Toolkit.getDefaultToolkit().getScreenSize(); public static final Dimension DIMENSIUNE_FEREASTRA=new Dimension(800,600); public static final String DIRECTOR_POZE="poze"; public static final char[] COD_CORECT={'1','2','3'}; public static final Pattern PATTERN_NUME=Pattern.compile("[A-Z]('[A-Z])?([a-z])+"); public static final Pattern PATTERN_PRENUME=Pattern.compile("(\\b([A-Z])([a-z])+([ -])?)+"); public static final Pattern PATTERN_CNP=Pattern.compile("[01]([0-9]){12}"); public static final Pattern PATTERN_TELEFON_MOBIL=Pattern.compile("07([0-9]){8}"); public static final Pattern PATTERN_TELEFON_FIX=Pattern.compile("0[2-3]([0-9]){8}"); }
P.S. If someone can help via E-mail send me PM
Similar Threads
-
url-pattern
By Leila in forum Java ServletReplies: 0Last Post: 12-16-2010, 07:58 AM -
strategy pattern and bridge pattern
By jomypgeorge in forum New To JavaReplies: 2Last Post: 12-13-2010, 05:13 AM -
Class pattern to generate following pattern:-
By vxs in forum New To JavaReplies: 5Last Post: 07-14-2010, 11:15 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks