This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Java in General and the fly likes Case insensitive match Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Case insensitive match" Watch "Case insensitive match" New topic
Author

Case insensitive match

nimish kumar
Ranch Hand

Joined: Dec 04, 2009
Posts: 56
Hi,
How do I have a word match for case-insensitive, camel case match. Ex-
I want to find 'Insert' string from a SQL query. 'Insert' can be -
INSERT
insert
Insert
inserT

What should be pattern for the same.


IBM-IBM WebSphere Application Server Network Deployment V7.0, Core Administration.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

How are you doing your matching? Is it in the database or in code?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
nimish kumar
Ranch Hand

Joined: Dec 04, 2009
Posts: 56
I got the solution, just after posting the query
We will convert the string to uppercase and then search its soooo simple
We will convert the sql query and the string to be searched both in uppercase and then can do matching.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
I am sure there are better ways to do it with a regular expression.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Case insensitive match