aspose file tools
The moose likes Java in General and the fly likes Case insensitive match Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Case insensitive match" Watch "Case insensitive match" New topic
Author

Case insensitive match

nimish kumar
Ranch Hand

Joined: Dec 04, 2009
Posts: 54
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.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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


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

Joined: Dec 04, 2009
Posts: 54
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: 32682
    
    4
I am sure there are better ways to do it with a regular expression.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Case insensitive match
 
Similar Threads
Junit compile problem
case-iinsensitive
findByCriteria implementation approach
is the search case sensitive?
How to compare each individual char of 2 string