The initial string is [image:salmon-v5-09-14-2011.jpg]
I would like to capture the text \"salmon-v5-09-14-2011.jpg\" and used GSkinner\'s RegEx Tool
Use a look-behind:
(?<=:)[\w+.-]+
A look-behind (coded as (?<=someregex)
) is a zero-width match, so it asserts, but does not capture, the match.
Also, your regex may be able to be simplified to this:
(?<=:)[^\]]+
which simply grabs anything between (but not including) a :
and a ]
If you are always looking at strings in that format, I would use this pattern:
(?<=\[image:)[^\]]+
This looks behind for [image:
, then matches until the closing ]
You have the correct regex only the tool you're using is highlighting the entire match and not just your capture group. Hover over the match and see what "group 1" actually is.
If you want a slightly more robust regex you could try :([^\]]+)
which will allow for any characters other than ]
to appear in the file name portion.