需要有关正则表达式的帮助 [英] need help with regular expression
问题描述
我需要有关正则表达式的帮助....
我正在从药品数据库中搜索药品名称.每当我输入时,我都需要从数据库中获取相关药品...
例如,如果我输入"para tabs"作为输入,我希望所有以"para"开头的药物都具有"tabs"名称..
ex-扑热息痛500 mg片
parafin 2mg片
正则表达式非常差...请帮助我...
在此先感谢
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
推荐答案
尝试:
public static Regex regex = new Regex("para.*tabs.*", RegexOptions.IgnoreCase |
RegexOptions.CultureInvariant |
RegexOptions.Compiled);
获取 Expresso [ ^ ]-它是免费的,它检查并生成正则表达式.它确实有帮助,我希望自己能写出来.
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.
这篇关于需要有关正则表达式的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!