Hello!

The variable has text in which to find information. I plan to do this with regular expressions. Faced a problem when writing in C. The header file <regex.h> is missing in MS VS 2010, there is a file <regex>, but you cannot work with it, since it is intended for C ++, and I am writing in C (C).

Tell me, is there any alternative library / header file or a way to install the <regex.h> file in VS?

Thank!

PS I am so stubbornly writing in C, because I want to go later to objective-c. Or you can safely switch to C ++, since it will not cause problems when writing on objective-c? Or I'm wrong?

ZZY Dear @ HashCode , tell me, please, why I have lost the button "add comment" - I can not answer the questions?

  • And why not just stuff into the project regex.h? - knes 5:41 pm
  • @knes, are you sure that there are not any other third parties that will not be there in VS 2010 either? - VladislavMSK
  • > as it will not cause problems when writing on objective-c. The ability to think is what will save problems from writing in any PL. I immediately passed from Pascal. - VioLet
  • @VioLet, how are you doing? Have your applications in the AppStore? - VladislavMSK
  • one
    In general, I see two big perversions in the proposed topic: coding in С in VS and using regexp in C. - skegg

1 answer 1

Cross-platform approach is to use PRCE .

The ANSI C standard does not have regular expressions. GCC has support for regular expressions: Regular Expression Matching is the one regex.h that was mentioned. In Visual C ++, if you need to work with regular expressions, CAtlRegExp is connected (the code is taken to C ++ source code).

  • And what are the solutions for SI? - VladislavMSK
  • one
    So @byte replied - pcre. Other options - POSIX regexp from gnu gnu.org/software/libc/manual/html_node/Regular-Expressions.html Well, and since MV VC is Windows, then there is another option (available from the 90s) - using the object regexp (from JScript / VBScript). Requires IE :) - alexlz
  • @byte, @alexlz, I paraphrase my question: How do I install these regular expressions in MS VS 2010, what would they work with in YaP C (C)? Thank. - VladislavMSK
  • I honestly answer - I do not know, and I do not have MS VS. Looked, there on ftp in the Contrib directory is pcre-vsbuild.zip. The truth is there for VS 2005 and VS 2008. Try to download and build a library. It may help. POSIX regekspy in modern times is exotic, and using a com-server in C ++ is a rather perverted option. - alexlz
  • @alexlz, That is, to write the program that I want (and I wrote it for 2/3) - is this a perversion clean? I just did not get it. - VladislavMSK