1

I developed a sort of scripting language using Java as my parser, but now I'm trying to improve it by recreating it with c++ in Xcode. I really need REGEX to make it work, but I'm not sure how to use REGEX with C++.

Does the newest version of Xcode (the Mac IDE) have a C++ REGEX library built into it? If so, what is it and how do I use it? If not, how can I get one and have Xcode recognize it?

Jason
  • 556
  • 1
  • 5
  • 21
  • 3
    1. It's not XCode, it's Xcode. 2. Xcode doesn't have built-in language features, libraries... it's not a compiler, it's an IDE. 3. If plain ol' C suits you, you may use the POSIX C header/libraey `regex.h` –  Jul 07 '12 at 22:18
  • 1
    1) is somewhat irrelevant, but thanks. I'll make sure to write it properly. 2) I know, but some IDE's package libraries (perhaps that's the wrong term, granted) with them that you can use. I'm also not sure which version of the c++ compiler it uses and what it has on it. 3) I'd rather use c++, but thanks for the suggestion. – Jason Jul 07 '12 at 23:20
  • 1
    Regular expressions are a lousy way to parse a scripting language. Have a look at flex and other parser generators. – Ben Voigt Jul 08 '12 at 01:02

1 Answers1

3

libc++ (which is available in Xcode 4.3 and will become the preferred standard library version in the next version, IIRC) supports the C++11 <regex> header.

Jens Kilian
  • 425
  • 2
  • 7
  • Thanks! How do I use libc++ in my project? When I try to #include it tells me it that can't find it. – Jason Jul 08 '12 at 07:35