Click here to Skip to main content
15,885,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need help with regex....
i am searching for a drug name from a drug data base..whenever i give a input i need to fetch the related drugs from the database...

for ex if i give "para tabs" as input i want all the drugs starting with "para" and have "tabs " in their name..
ex---paracetamol 500 mg tabs
parafin 2mg tabs


am very poor in regex...plz help me out...

thanks in advance
Posted

1 solution

Try:
public static Regex regex = new Regex("para.*tabs.*", RegexOptions.IgnoreCase |
                                                      RegexOptions.CultureInvariant |
                                                      RegexOptions.Compiled);


Get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions. It really helps and I wish I'd written it.
 
Share this answer
 
Comments
tolw 6-May-11 6:57am    
Thanks for the Expresso link. I wish I had it sooner :) Have a 5!
Sergey Alexandrovich Kryukov 6-May-11 10:43am    
Looks correct; my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900