@@ -1774,41 +1774,12 @@ LRESULT CSearchDlg::DoCommand(int id, int msg)
1774
1774
int uID = (id == IDC_EDITMULTILINE1 ? IDC_SEARCHTEXT : IDC_REPLACETEXT);
1775
1775
auto buf = GetDlgItemText (static_cast <int >(uID));
1776
1776
std::wstring ctrlText = buf.get ();
1777
-
1778
- // replace all \r\n strings with real CRLFs
1779
- try
1780
- {
1781
- int ft = boost::regex::normal;
1782
- boost::wregex expression = (id == IDC_EDITMULTILINE1
1783
- ? boost::wregex (L" \\ (\\ ?:\\\\ n\\ |\\\\ r\\\\ n\\ |\\\\ n\\\\ r\\ )" , ft)
1784
- : boost::wregex (L" \\\\ r\\\\ n" , ft));
1785
- boost::match_flag_type rFlags = boost::match_default | boost::format_all;
1786
- ctrlText = regex_replace (ctrlText, expression, L" \\ r\\ n" , rFlags);
1787
- }
1788
- catch (const std::exception&)
1789
- {
1790
- }
1791
1777
CMultiLineEditDlg editDlg (*this );
1792
1778
editDlg.SetString (ctrlText);
1793
1779
1794
1780
if (editDlg.DoModal (hResource, IDD_MULTILINEEDIT, *this ) == IDOK)
1795
1781
{
1796
1782
std::wstring text = editDlg.GetSearchString ();
1797
- // replace all CRLFs with \r\n strings (literal)
1798
- try
1799
- {
1800
- int ft = boost::regex::normal;
1801
- boost::wregex expression = boost::wregex (L" \\ r\\ n" , ft);
1802
- boost::match_flag_type rFlags = boost::match_default | boost::format_all;
1803
- if (id == IDC_EDITMULTILINE1)
1804
- text = regex_replace (text, expression, L" \\ (\\ ?:\\\\ n|\\\\ r\\\\ n|\\\\ n\\\\ r\\ )" , rFlags);
1805
- else
1806
- text = regex_replace (text, expression, L" \\\\ r\\\\ n" , rFlags);
1807
- }
1808
- catch (const std::exception&)
1809
- {
1810
- }
1811
-
1812
1783
SetDlgItemText (*this , static_cast <int >(uID), text.c_str ());
1813
1784
}
1814
1785
::SetFocus (GetDlgItem(*this , uID));
@@ -3441,6 +3412,7 @@ DWORD CSearchDlg::SearchThread()
3441
3412
if (!m_searchString.empty ())
3442
3413
{
3443
3414
escapeForRegexEx (m_searchString, 0 );
3415
+ SearchReplace (m_searchString, L" \\ r\\ n" , L" \\ (\\ ?:\\\\ n|\\\\ r|\\\\ r\\\\ n\\ )" ); // multi-line
3444
3416
}
3445
3417
if (m_bReplace && !m_replaceString.empty ())
3446
3418
{
0 commit comments