-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathCommentRegex.cpp
More file actions
42 lines (33 loc) · 1.31 KB
/
CommentRegex.cpp
File metadata and controls
42 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
* See also https://openstudio.net/license
***********************************************************************************************************************/
#include "CommentRegex.hpp"
namespace openstudio {
namespace commentRegex {
const boost::regex& whitespaceOnlyLine() {
static const boost::regex result("^[\\h]*$");
return result;
}
const boost::regex& commentWhitespaceOnlyLine() {
static const boost::regex result("^[\\h]*(?:!([^\\n\\r\\v]*))?$");
return result;
}
const boost::regex& editorCommentWhitespaceOnlyLine() {
static const boost::regex result("^[\\h]*(?:!-([^\\n\\r\\v]*))?$");
return result;
}
const boost::regex& whitespaceOnlyBlock() {
static const boost::regex result("[\\s]*");
return result;
}
const boost::regex& commentWhitespaceOnlyBlock() {
static const boost::regex result("(?:^[\\h]*(?:![^\\v\\n]*)?[\\v\\n]?)*");
return result;
}
const boost::regex& editorCommentWhitespaceOnlyBlock() {
static const boost::regex result("(?:^[\\h]*(?:!-[^\\v\\n]*)?[\\v\\n]?)*");
return result;
}
} // namespace commentRegex
} // namespace openstudio