Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regular Expression

 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a text like this.


I want a regular expression that is match to every word related to car. Eg. Car, cars, CAR, car.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far?
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12097
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you want to match words like "Oscar" or "baccarat"? One of the tricks is that you have to first know and define what you do want, and what you don't want. A list of examples does not define that, as they don't account for all possible cases.
 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I want only car and cars ignoring case.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4314
233
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Udaya Wijenayake wrote:No, I want only car and cars ignoring case.

David Newton wrote:What have you tried so far?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic