in reply to Re^5: regex subst not DWIM
in thread regex subst not DWIM
Input snippet:
gets turned into output snippet:/// <summary> /// Checks to see if the data on the clipboard supports /// the given data type. /// </summary> /// <param name="dataType">The data type to check for.</param> /// <returns><c>true</c> if the data type is present.</returns +> public bool ClipboardDataHasType(string dataType) { return dataType == m_dataType; } /// <summary> /// Gets the clipboard data. /// </summary> /// <param name="dataType">Type of the data.</param> /// <returns> /// The data on the clipboard matching the datatype /// </returns> public object GetClipboardData(string dataType)
Basically, the if ($file =~ /$comment$method/) { line is never matching, where $method is the declaration line and $comment is:/// <summary> /// Checks to see if the data on the clipboard supports /// the given data type. /// </summary> /// <param name="dataType">The data type to check for.</param> /// <returns><c>true</c> if the data type is present.</returns +> /// <summary> /// public bool ClipboardDataHasType(string dataType) /// </summary> /// <param name="dataType">string</param> public bool ClipboardDataHasType(string dataType) { return dataType == m_dataType; } /// <summary> /// Gets the clipboard data. /// </summary> /// <param name="dataType">Type of the data.</param> /// <returns> /// The data on the clipboard matching the datatype /// </returns> /// <summary> /// public object GetClipboardData(string dataType) /// </summary> /// <param name="dataType">string</param> public object GetClipboardData(string dataType)
This is the case whether I specify s, m, or both (in either sequence) for the matching.\\s*///\\s*<summary>\\s*///.*\\n\\s*///\\s*</summary>\\n(\\s*///.*\\n) +*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: regex subst not DWIM
by suaveant (Parson) on Dec 21, 2007 at 14:23 UTC |