Decoding a regex

java, regex

Solution

You could use the Regular Expression Analyzer at http://www.myezapp.com/apps/dev/regexp/show.ws or http://www.debuggex.com/

^ = start of string
() = capturing groups
[] = character classes
\d = digit in 0-9
\\ = literal backslash
| = OR
{} = count of leading item
$ = end of string

Problem

I am looking to decode a regular expression. Is there a way to check what the below regex means: ``` ^(PC([Y\\d])|GC([Y\\d])|Y|\\d)\\d{4,5}$ ```

Original source