开发者

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 \ws.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜