diff --git a/applications/test/dictionary/testDictRegex b/applications/test/dictionary/testDictRegex index ee4bf298e0..01d4274ba8 100644 --- a/applications/test/dictionary/testDictRegex +++ b/applications/test/dictionary/testDictRegex @@ -15,21 +15,21 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #inputMode merge -'.*' parentValue1; -'[n-z].*' parentValue2; -'f.*' parentValue3; +".*" parentValue1; +"[n-z].*" parentValue2; +"f.*" parentValue3; keyX parentValue4; keyY parentValue5; -'(.*)Dict' +"(.*)Dict" { foo subdictValue0; bar $f.*; // should this really match 'foo'? // result is dependent on insert order! - 'a.*c' subdictValue3; - 'ab.*' subdictValue2; - 'a.*' subdictValue1; + "a.*c" subdictValue3; + "ab.*" subdictValue2; + "a.*" subdictValue1; abcd \1; } diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSetDict b/applications/utilities/mesh/manipulation/cellSet/cellSetDict index 61f8ed4432..8dafcd3fa2 100644 --- a/applications/utilities/mesh/manipulation/cellSet/cellSetDict +++ b/applications/utilities/mesh/manipulation/cellSet/cellSetDict @@ -82,7 +82,7 @@ topoSetSources // Cells in cell zone zoneToCell { - name '.*Zone'; // Name of cellZone, regular expressions allowed + name ".*Zone"; // Name of cellZone, regular expressions allowed } // values of field within certain range diff --git a/applications/utilities/mesh/manipulation/faceSet/faceSetDict b/applications/utilities/mesh/manipulation/faceSet/faceSetDict index 04c0ee2837..4d5abe2a5e 100644 --- a/applications/utilities/mesh/manipulation/faceSet/faceSetDict +++ b/applications/utilities/mesh/manipulation/faceSet/faceSetDict @@ -56,13 +56,13 @@ topoSetSources // All faces of patch patchToFace { - name '.*Wall'; // Name of patch, regular expressions allowed + name ".*Wall"; // Name of patch, regular expressions allowed } // All faces of faceZone zoneToFace { - name '.*Zone1'; // Name of faceZone, regular expressions allowed + name ".*Zone1"; // Name of faceZone, regular expressions allowed } // Faces with face centre within box diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSetDict b/applications/utilities/mesh/manipulation/pointSet/pointSetDict index b7215c64e6..1c704a1868 100644 --- a/applications/utilities/mesh/manipulation/pointSet/pointSetDict +++ b/applications/utilities/mesh/manipulation/pointSet/pointSetDict @@ -60,7 +60,7 @@ topoSetSources // All points in pointzone zoneToPoint { - name '.*Zone'; // name of pointZone, regular expressions allowed + name ".*Zone"; // name of pointZone, regular expressions allowed } // Select based on surface diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C index c0d1a03535..960ec0ff66 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C @@ -48,7 +48,7 @@ void Foam::Ostream::decrIndent() // Write keyType -// write regular expression as single-quoted string +// write regular expression as quoted string // write plain word as word (unquoted) Foam::Ostream& Foam::Ostream::write(const keyType& kw) { diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H index 6d01d46438..f82c796222 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H @@ -115,7 +115,7 @@ public: //- Write string virtual Ostream& write(const string&) = 0; - //- Write std::string surrounded by single quotes. + //- Write std::string surrounded by quotes. // Optional write without quotes. virtual Ostream& writeQuoted ( diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H index b02f892d9e..6db9a827b1 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H @@ -136,7 +136,7 @@ public: //- Write string Ostream& write(const string&); - //- Write std::string surrounded by single quotes. + //- Write std::string surrounded by quotes. // Optional write without quotes. Ostream& writeQuoted ( diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index c94e6c9bbc..01b92cacee 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -152,9 +152,8 @@ Foam::Istream& Foam::ISstream::read(token& t) return *this; } - // Strings: enclosed by single or double quotes. + // Strings: enclosed by double quotes. case token::BEGIN_STRING : - case token::BEGIN_QSTRING : { putback(c); string* sPtr = new string; @@ -369,11 +368,8 @@ Foam::Istream& Foam::ISstream::read(string& str) char endTok = token::END_STRING; - if (c == token::BEGIN_QSTRING) - { - endTok = token::END_QSTRING; - } - else if (c != token::BEGIN_STRING) + // Note, we could also handle single-quoted strings here (if desired) + if (c != token::BEGIN_STRING) { buf[0] = '\0'; diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C index a954f1b778..ac04467f3c 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C @@ -118,7 +118,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted { if (quoted) { - os_ << token::BEGIN_QSTRING; + os_ << token::BEGIN_STRING; register int backslash = 0; for @@ -141,7 +141,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted lineNumber_++; backslash++; // backslash escape for newline } - else if (c == token::END_QSTRING) + else if (c == token::END_STRING) { backslash++; // backslash escape for quote } @@ -158,7 +158,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted // silently drop any trailing backslashes // they would otherwise appear like an escaped end-quote - os_ << token::END_QSTRING; + os_ << token::END_STRING; } else { diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H index d4f552bd53..75d18ef793 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H @@ -141,7 +141,7 @@ public: // double-quote. virtual Ostream& write(const string&); - //- Write std::string surrounded by single quotes. + //- Write std::string surrounded by quotes. // Optional write without quotes. virtual Ostream& writeQuoted ( diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.H b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.H index aede82b4b9..10ae981ca7 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.H +++ b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.H @@ -114,8 +114,8 @@ public: //- Write string virtual Ostream& write(const string&); - //- Write std::string - // Specify if string should be single quoted or remain unquoted. + //- Write std::string surrounded by quotes. + // Optional write without quotes. virtual Ostream& writeQuoted ( const std::string&, diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 9cd5bde737..cf51ad8a09 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -109,8 +109,6 @@ public: BEGIN_STRING = '"', END_STRING = BEGIN_STRING, - BEGIN_QSTRING = '\'', - END_QSTRING = BEGIN_QSTRING, ASSIGN = '=', ADD = '+',