Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Case insensitive match

 
nimish kumar
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you doing your matching? Is it in the database or in code?
 
nimish kumar
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48424
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sure there are better ways to do it with a regular expression.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic