<commit_before># - Find pcre
# Find the native PCRE2 headers and libraries.
#
# PCRE2_INCLUDE_DIRS    - where to find pcre.h, etc.
# PCRE2_LIBRARIES   - List of libraries when using pcre.
# PCRE2_FOUND   - True if pcre found.

# Look for the header file.
FIND_PATH(PCRE2_INCLUDE_DIR pcre2.h)

# Look for the library.
FIND_LIBRARY(PCRE2_LIBRARY NAMES libpcre2.a pcre2-8)

# Check required version
execute_process(COMMAND pcre2-config --version OUTPUT_VARIABLE PCRE2_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)

# Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 REQUIRED_VARS PCRE2_LIBRARY PCRE2_INCLUDE_DIR VERSION_VAR PCRE2_VERSION)

# Copy the results to the output variables.
IF(PCRE2_FOUND)
    SET(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
    SET(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
ELSE(PCRE2_FOUND)
    SET(PCRE_LIBRARIES)
    SET(PCRE_INCLUDE_DIRS)
ENDIF(PCRE2_FOUND)

MARK_AS_ADVANCED(PCRE2_INCLUDE_DIRS PCRE2_LIBRARIES)<commit_msg>cmake REFACTOR update findpcre2 module<commit_after># - Find pcre
# Find the native PCRE2 headers and libraries.
#
# PCRE2_INCLUDE_DIRS    - where to find pcre.h, etc.
# PCRE2_LIBRARIES   - List of libraries when using pcre.
# PCRE2_FOUND   - True if pcre found.
include(FindPackageHandleStandardArgs)

if(PCRE2_LIBRARIES AND PCRE2_INCLUDE_DIRS)
    # in cache already
    set(PCRE2_FOUND TRUE)
else()
    find_path(PCRE2_INCLUDE_DIR
        NAMES
        pcre2.h
        PATHS
        /usr/include
        /usr/local/include
        /opt/local/include
        /sw/include
        ${CMAKE_INCLUDE_PATH}
        ${CMAKE_INSTALL_PREFIX}/include)

    # Look for the library.
    find_library(PCRE2_LIBRARY
        NAMES
        libpcre2.a
        pcre2-8
        PATHS
        /usr/lib
        /usr/lib64
        /usr/local/lib
        /usr/local/lib64
        /opt/local/lib
        /sw/lib
        ${CMAKE_LIBRARY_PATH}
        ${CMAKE_INSTALL_PREFIX}/lib)

    if(PCRE2_LIBRARY)
        # Check required version
        execute_process(COMMAND pcre2-config --version OUTPUT_VARIABLE PCRE2_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
    endif()

    set(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
    set(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
    mark_as_advanced(PCRE2_INCLUDE_DIRS PCRE2_LIBRARIES)

    # Handle the QUIETLY and REQUIRED arguments and set PCRE2_FOUND to TRUE if all listed variables are TRUE.
    find_package_handle_standard_args(PCRE2 FOUND_VAR PCRE2_FOUND
        REQUIRED_VARS PCRE2_LIBRARY PCRE2_INCLUDE_DIR
        VERSION_VAR PCRE2_VERSION)
endif()
{'fraction_non_alphanumeric': 0.06449165402124431, 'fraction_numerical': 0.022003034901365705, 'mean_word_length': 3.5154109589041096, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5601591', 'n_tokens_mistral': 1038, 'n_tokens_neox': 961, 'n_words': 205}