我试图解析使用Python和正则表达式正则表达式:如果,否则,如果,否则
regex_cond = re.compile(r'.+((else\tif|else|if)).+')
line2 = '@s0 else if (insreg==1) then (initx,PING,notend) -> sinitx;'
match = regex_cond.match(line2);
我有问题要区分Gezel语言(http://rijndael.ece.vt.edu/gezel2/)的FSM声明如果和否则,如果。 其他如果在该示例中被识别为如果。
不是标签吗?所以它实际上是搜索其他,而不是如果?我会尝试切换到其他\ sif。 –
martiert
2010-08-12 14:43:18