I have a regular expression (regex) that I would like to understand exactly what it means, in the context of the libc library, regex.h, in C. I run software that generates regular expressions, sort of at random but according to a grammar, and it generated one particular one that I'm very interested in. I have done an extensive regex tutorial and read the POSIX 1003.2 specification for regexes but am still unsure as to what it means.
The regex is
It compiles and executes without error. I thought that nested character classes were not allowed, and yet this was executed.Code:[A[ACGTN][ACGTN]G]*
My interpretation so far is as follows:
one single character which could be A, [, A, C, G, T, or N,
followed by one single character which could be A, C, G, T, or N,
followed by the character 'G',
followed by zero or more repetitions of the character ']'.
Does anyone know if I've got it wrong or right? I'd appreciate any help anyone can give on this. (I know it isn't the most elegant regex, but I still need to know what it means ).