/
(\$)
# Regexp for textmate dynamic variables
#TM_(
# BUNDLE_SUPPORT|COMMENT_(?:END|MODE|START)|CURRENT_(?:LINE|WORD)|DIRECTORY|FILE(?:NAME|PATH)|
# LINE_(?:INDEX|NUMBER)|PROJECT_DIRECTORY|SCOPE|SELECTED_(?:FILE[S]?|TEXT)|SOFT_TABS|SUPPORT_PATH|TAB_SIZE
#)
(?:
# BASIC
# BASIC: Variable name, no brackets
(?:(TM_[A-Z]+(?:_[A-Z]+)*)|([\d]))(?!\{)
|
# BRACKETED
([\{])
# BRACKETED: Variable name
(?:(TM_[A-Z]+(?:_[A-Z]+)*)|([\d]))
# BRACKETED: Post variable name expression
(?:
# Default keyword, single
([:].+?(?=[\}]))
|
# Default keyword, options
([\|].+?[\|](?=[\}]))
|
# Regular expression
(?:
([\/])
(.+?(?=\/))
([\/])
(.+?(?=\/))
([\/])
# Flags
# Not sure how to validate fully without back references?
([imx]{3})
(?=\})
)
|
(?:
([\/])
([^\/\}]+?)
(
(?<![\\]{2})
[\/]
)
([^\/\}]+?)
(
(?<![\\]{2})
[\/]
)
# Flags
# Not sure how to validate fully without back references?
([imx]{3})
)
|
# Match to bracket
(.+?(?=[\}]))?
)?
([\}])
)
/
gmxX