Regular Expressions in C

后端 未结 7 938
梦如初夏
梦如初夏 2021-01-01 02:42

I\'m curious, does anybody know a good way to do regular expression matching in C? The only way I can think of is through Flex. Is this the only way or is there a better w

7条回答
  •  感动是毒
    2021-01-01 03:16

    Uh ... The best way is to

    #include 
    

    That is the POSIX standard API for regular expressions.

    For non-POSIX systems, rolling your own is one alternative, a basic regex engine is not too hard to accomplish. I'm sure there are off-the-shelf solutions too, I haven't neded one.

    Come to think of it, I think glib has one.

提交回复
热议问题