regex store string of undertemined size
I have strings in quotes that I want to store and replace. It is a long JS开发者_开发问答ON script that I want to tweak without doing it manually. There are a lot of values in "quotes" because that is the syntax.
"Variable" : {
definitions
}
I wanted to find these variables of underdetermined length using
"(\w)" : \{
definitions
\}
but it isn't working. TextWrangler's grep is not finding anything. I think \w is just for a single character, is there a way to find and store an undetermined amount of characters? I wanted to use a wildcard like * but this was giving me error or not finding anything
What should I be using?
\w*
or \w\*
will match zero or more alphanumeric/underscore characters; whether a backslash is required before *
depends on the specific regex implementation. Alternatively, you can use \w+
or \w\+
to match one or more \w
s.
精彩评论