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) +*
In reply to Re^6: regex subst not DWIM
by girarde
in thread regex subst not DWIM
by girarde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |