Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't regular expressions part of ISO C99

Everyone knows how awesome C language is and how much it sucks in text processing tasks. Given these facts. Regex definitely must be part of ISO C. But it isn't. I don't understand why? Are there people who think its not essential?

like image 571
claws Avatar asked Jul 15 '10 20:07

claws


2 Answers

Regular Expressions don't belong in the C language proper any more than a sound library, a graphics library, or an encryption library does. Doing so would reduce the general purpose nature of the language and greatly inhibit its use as a small and efficient embedded language.

The philosophy of C was to have a very small and efficient language keyword set with standardized libraries for the next layer of functionality. Since things like regex, graphics, sound, encryption, etc. don't have a single platform or standard they don't fit in with the standard C library.

They fit best as user libraries which they currently are.

like image 142
Amardeep AC9MF Avatar answered Oct 09 '22 22:10

Amardeep AC9MF


Regex is defined as part of IEEE Std 1003.1:2001 (POSIX)

Here's a handly list of which headers are in which standard:

http://www.schweikhardt.net/identifiers.html

like image 41
tovare Avatar answered Oct 09 '22 21:10

tovare