wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 19651
    
  18

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: 37940
    
  22
I am sure there are better ways to do it with a regular expression.
 
wood burning stoves
 
subject: Case insensitive match
 
Similar Threads
findByCriteria implementation approach
How to compare each individual char of 2 string
Junit compile problem
is the search case sensitive?
case-iinsensitive