Qu'est-ce qu'une expression régulière pour correspondre au mot call
ou CALL
dans la chaîne suivante en C#?Regex pour faire correspondre dans les chaînes
NIFTY-CALL-1200-Aug11
NIFTY CALL 1200 Aug11
NIFTYCALL-CALL-1200-Aug11 //In this case second call word must be matched not NIFTYCALL.
NIFTYCALL CALL 1200 Aug11 //In this case second call word must be matched not NIFTYCALL.
CALLNIFTY CALL 1200 Aug11 //In this case second call word must be matched not CALLNIFTY.
CALLNIFTY CALL 1200 Aug11 //In this case second call word must be matched not CALLNIFTY.
CALLNIFTY Aug11 1200CALL //In this case last call word must be matched not CALLNIFTY.
CALLNIFTY 1200 Aug11CALL //In this case last call word must be matched not CALLNIFTY.
, Cela fonctionne super.Merci.Mais je ne comprends pas la première partie correctement pour la limite de mot (?: Harikrishna
@Harikrishna - le '\ b' est une limite de mot, le' | 'est équivalent à une déclaration' or', le '[0-9]' est un chiffre (le même que \ d que Pengyu utilisé). Tout ceci est enveloppé dans un groupe sans capture '(?: ....)'. –