Results 1 to 3 of 3
Thread: Regular Expressions in java
- 09-25-2008, 12:24 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 2
- Rep Power
- 0
- 09-25-2008, 04:23 PM #2
If name and id are String variables, then you can use the == operator to test for null values.
I don't know how a regex can look at nothing. It could look at an empty string.
The == test for null is the simplest.
Or is the problem: Your have a String: 'null:xxx' or 'xxx:null' and you want to see if that string contains the string "null"?
Look at the Pattern and Matcher classes. Search will probably get you several examples.Last edited by Norm; 09-25-2008 at 04:25 PM.
- 09-26-2008, 03:43 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 26
To find the null you can't use a regular expression, not a 'null' string. So as Norm you can use == operator in simple way.
I'm not clear what you are asking here anyway. Can you more descreptive
Similar Threads
-
Regular expressions from command prompt
By GenkiSudo in forum New To JavaReplies: 2Last Post: 09-21-2008, 02:40 PM -
Using Quantifiers in regular expressions
By Java Tip in forum Java TipReplies: 0Last Post: 01-10-2008, 10:43 AM -
Capturing Groups using regular expressions
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 11:19 AM -
Regular expressions quantifiers
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 11:18 AM -
regular expressions and string matching
By DennyLoi in forum New To JavaReplies: 1Last Post: 11-16-2007, 10:15 AM
Bookmarks