Skip to content

Commit

Permalink
Switch to using pcre::regex instead of boost::regex
Browse files Browse the repository at this point in the history
Drop dependency on Boost.Regex library and use PCRE-based regex class
instead.

Using PCRE-based implementation is advantageous compared to using
std::regex because it has a much better performance and also has more
features, notably it supports "?<=" look-behind assertions not supported
by the standard class, that are used in the existing code.

The only regex change needed was the one replacing "\l", which is not
recognized by PCRE (nor std::regex) as a character class shorthand with
the explicit use "[:lower:]".
  • Loading branch information
vadz committed Jun 10, 2021
1 parent 29f6659 commit f1a3521
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 718 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/ci.yml
Expand Up @@ -204,23 +204,6 @@ jobs:
if: steps.cache-local.outputs.cache-hit != 'true'
run: ./install_wxpdfdoc.sh

- name: Build Boost.Regex
if: matrix.autotools
run: |
# Define flags to avoid warnings in Boost code we don't care about.
boost_cxxflags="-Wno-deprecated-declarations -Wno-register -DBOOST_NO_AUTO_PTR -DBOOST_NO_STD_ALLOCATOR"
if [ "${{ matrix.compiler }}" = clang ]; then
boost_cxxflags="${boost_cxxflags} -Wno-parentheses-equality"
fi
for lib in regex; do
cd /opt/lmi/third_party/src/boost/libs/${lib}/src
echo "Compiling $lib sources"
${CXX-${LMI_COMPILER}} -std=c++17 -fPIC $(echo ${boost_cxxflags}) -I../../.. -c *.cpp
echo "Creating libboost_${lib}.a from" *.o
ar rc /opt/lmi/local/${LMI_COMPILER}_${LMI_TRIPLET}/lib/libboost_${lib}.a *.o
done
- name: Configure lmi
if: matrix.autotools
run: |
Expand Down
1 change: 0 additions & 1 deletion Makefile.am
Expand Up @@ -1132,7 +1132,6 @@ noinst_HEADERS = \
authenticity.hpp \
basic_tables.hpp \
basic_values.hpp \
boost_regex.hpp \
bourn_cast.hpp \
cache_file_reads.hpp \
calendar_date.hpp \
Expand Down
330 changes: 0 additions & 330 deletions boost_1_33_1.patch

This file was deleted.

0 comments on commit f1a3521

Please sign in to comment.