regextextmateoniguruma

Textmate Find and Replace with Wildcard


Here's what I have in a few hundred places [:admin, @account]. What I want to do is remove the [:admin, ] so that all that's left is @account or whatever object I have there. Because sometimes it's [:admin, ticket] or [:admin, group].

Is it possible with Regex to get rid of the wrapped bracket([]) and :admin,?


Solution

  • Don't know, how exactly textmate is handling regex, but in Scintilla-base it would be something like

    \[:admin,\s+([^\]]+)\]
    $1