python - regular expression -


I need to find all the inventions of some logging macros in the code. I have a macro invoice form:

< Pre DEBUG [1-5] ("method name: log message", logic)

But the new version of macros are automatically named before, So my job is to write a Python script which will remove duplicate function names already specified by the programmer.

I am using the subfunction again to change the module I mentioned. Below are the hints: || DEBUG [1-5] ("Law Name: Login Message", Logic) with the debug [1- 5] ("

The problem is the following:

I think that to find the sense, I use the following regular expression:

  ((DEBUG | INFO | all other macros Name) [1-5] *) \ s * \ (\ "\ w +:  

but it matches the whole expression (from debuges to the colon), but only macros Name, which is for DEBUG5 example.

Is my expression wrong? Is there some disagreement in Python's reggae processing? (Perhaps the fact is that I use DEBUG [1-5] as a subgroup to do something with this?) I appreciate any help from someone more knowledgeable than anyone. Try it. Try it in Java, but you can convert it to a python

   

ReplaceAll ("[DEBUG [1-5] \\ * \\ (\") \ "[^:] +: \\ s + ([^;] +)," $ 1 $ 2 "); < / Code>


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -