我有這樣的代碼註釋塊..正則表達式來讀取代碼註釋
/**
* This method provide inheritance to the object supplied; this method inherit the
* public methods from the Parent class to the Child class. this also provide
* multiple inheritance, in which the method ambiguity is solved by the overriding
* the last inherited class's method.
* @access public
* @method inherit
* @param Object Parent
* @param Object Child
* @return Object
*/
,並忽略註釋像
/* This is a test comment for testing regex. */
我嘗試了很多在JavaScript中使用正則表達式來獲得此評論和每一個失敗時間。任何人都可以建議這個或任何其他解決方案提取註釋塊的正則表達式。
告訴我們你試過了什麼? – 2013-02-16 14:38:52
你應該精確地確定你想要的。也許爲什麼很多關於C++風格評論的正則表達式的文章沒有回答你的問題。 – 2013-02-16 14:39:56
i tired this/\ *([^ *] | [\ r \ n] |(\ * +([^ * /] | [\ r \ n]))* \ * – 2013-02-16 14:42:38