Start Info Community Spielen
 
 

Morgengrauner Dokumentation

Dateipfad: /home/mud/mudlib/doc//efun/regexp_package

SYNOPSIS
        #include 

        int regexp_package()

DESCRIPTION
        Return which regexp package is used by default:

          RE_TRADITIONAL: traditional regexps
          RE_PCRE:        PCRE

        As the package can be selected at runtime through the
        REGEXP_PACKAGE driver hook, there is no good way to determine
        the package at LPC compile time.
        Match the pattern  (interpreted according to  if
        given) against all strings in list, and return a new array with all
        strings that matched.

        If there is an error in the regular expression, a runtime
        error will be raised.

EXAMPLE
        string strs;
        string pattern;
        
        if (regexp_package() == RE_PCRE)
            pattern = "\\.*\\";
        else
            pattern = "\\bhelp\\b.*\\bme\\b";

        if (strs = regexp( ({"please, help me Sir John."}),
                         , pattern
                         ))
        {
           if (sizeof(strs)
              write("It matches.\n");
        }

        The regular expression will test the given string (which is
        packed into an array) if there is something like "help ... me"
        inside of it.

HISTORY
        Introduced in LDMud 3.3.634.

SEE ALSO
        regexp(E), regexplode(E), regmatch(E), regreplace(E), sscanf(E),
        regexp(C), regexp_package(H)


zurück zur Übersicht

YOUTUBE | FACEBOOK | TWITTER | DISCORD | FEEDBACK | IMPRESSUM | DATENSCHUTZ 1992–2023 © MorgenGrauen.