Skip to main content
RockyBalboa
Associate
January 24, 2023
Question

How to run regex in CubeIDE version: 1.11.0

  • January 24, 2023
  • 2 replies
  • 2891 views

Hello community. I have question. I would like to use regular expressions regex. It adds #include <regex.h> and tries to use the regcomp or regexec function. Unfortunately after compilation I get the error "undefined reference to regcomp". How do I get regex to work in CubeIDE version 1.11.0, what do I need to do?

This topic has been closed for replies.

2 replies

RockyBalboa
Associate
January 25, 2023

I saw this topic but I don't know how i put this library https://github.com/kokke/tiny-regex-c to CubeIDE

KnarfB
Super User
January 25, 2023

git clone/download the re.c and re.h files and put them in the Inc/Src folder of your project. Include "re.h" The API is different, but looks straightforward to me.

hth

KnarfB

KnarfB
Super User
January 26, 2023

The bar | is not used in re.c so there is no need for escape. It's probably only a matter of correct backslashing. But I think the OP shall find that out by reviewing the source or debugging or trial-and-error.

hth

KnarfB