{"id":13699352,"url":"https://github.com/eriknyquist/librxvm","last_synced_at":"2025-08-02T04:08:05.456Z","repository":{"id":84199580,"uuid":"49022820","full_name":"eriknyquist/librxvm","owner":"eriknyquist","description":"non-backtracking NFA-based regular expression library, for C and Python","archived":false,"fork":false,"pushed_at":"2020-10-04T18:49:44.000Z","size":1653,"stargazers_count":61,"open_issues_count":8,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-01T05:31:55.970Z","etag":null,"topics":["compiler","compiler-design","compilers","hacktoberfest","nfa","parser","parsers","parsing","pattern-matching","patterns","regex","regex-pattern","regexes","regexp"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eriknyquist.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-01-04T21:00:10.000Z","updated_at":"2024-05-31T15:20:41.000Z","dependencies_parsed_at":"2023-05-23T22:45:45.389Z","dependency_job_id":null,"html_url":"https://github.com/eriknyquist/librxvm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eriknyquist/librxvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Flibrxvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Flibrxvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Flibrxvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Flibrxvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eriknyquist","download_url":"https://codeload.github.com/eriknyquist/librxvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Flibrxvm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334093,"owners_count":24233782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","compiler-design","compilers","hacktoberfest","nfa","parser","parsers","parsing","pattern-matching","patterns","regex","regex-pattern","regexes","regexp"],"created_at":"2024-08-02T20:00:31.182Z","updated_at":"2025-08-02T04:08:05.433Z","avatar_url":"https://github.com/eriknyquist.png","language":"C","readme":"librxvm: non-backtracking NFA-based C library for regular expressions\n=====================================================================\n\n\n.. |travis_badge| image:: https://travis-ci.org/eriknyquist/librxvm.svg?branch=master\n    :target: https://travis-ci.org/eriknyquist/librxvm\n\n.. |appveyor_badge| image:: https://ci.appveyor.com/api/projects/status/v7mj5v1xjg8rqdr5?svg=true\n    :target: https://ci.appveyor.com/project/eriknyquist/librxvm\n\nLinux, OSX :  |travis_badge|\n\nWindows :  |appveyor_badge|\n\n|\n\n.. contents:: Table of Contents\n\nIntroduction\n------------\n\nShort one\n^^^^^^^^^\n\n``librxvm`` is a C library for matching regular expressions on large sets of\ndata.\n\nLong one\n^^^^^^^^\n\n``librxvm`` is a **R**\\ egular e\\ **X**\\ pression **V**\\ irtual **M**\\ achine.\nIt compiles a regular expression into an NFA representation consisting of a\nsequence of primitive opcodes for a \"`virtual machine \u003chttps://swtch.com/~rsc/regexp/regexp2.html\u003e`_\"\n(the \"machine\" here is theoretical, rather than physical hardware, and is\nimplemented as  a simple bytecode interpreter). The virtual machine can then\nexecute the NFA representation, or \"program\" against some input text to\ndetermine whether the input text matches the regular expression.\n\nIn addition to the usual string matching \u0026 searching functions, librxvm also\nprovides a function (``rxvm_fsearch``) that takes a FILE pointer for large sets\nof input data. ``rxvm_fsearch`` uses the Boyer-Moore-Horspool algorithm to\nachieve **extremely high** throughput for regular expression searches on any\ndata that can be accessed through a standard ``FILE`` pointer. You can try it\nout with the ``rxvm_fsearch`` example application.\n\nSpeed test: using the ``rxvm_fsearch`` function to search a 1GB plain-text file\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n    $\u003e ls -lh file\n    -rw-r--r-- 1 enyquist enyquist 954M Jul 23 21:55 file\n\n    $\u003e time examples/rxvm_fsearch \"eriknyquist\" file\n\n    eriknyquistB6dvGZ7wxvd9pqXnep5wABDee7UqaNibTUch/LUAcAjqRPAnQBpMjdG3w7R4wR+1082/ctpmmWk\n\n    real    0m0.528s\n    user    0m0.444s\n    sys 0m0.084s\n\n    $\u003e\n\n528 milliseconds-- pretty fast. In fact, if we search for longer strings, we can\ngo even faster, because of how the Boyer-Moore string searching algorithm works\n\n::\n\n    $\u003e time examples/rxvm_fsearch \"this is a long string\" file\n\n    real    0m0.424s\n    user    0m0.300s\n    sys 0m0.120s\n\n    $\u003e time examples/rxvm_fsearch \"this is a very very very very veeeeeeeeeerrrrrrrrrryyyyyyyyyyyyy long string\" file\n\n    real    0m0.197s\n    user    0m0.068s\n    sys 0m0.128s\n\nUnder 200 milliseconds to search a 1GB file, when the search pattern contains a\nfixed string of ~80 characters or more. That's fast!\n\nWhat's missing from ``librxvm``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n* Currently, ``librxvm`` only works with plain ol' ASCII.\n* It's not POSIX compliant, or anything compliant as far as I know.\n* Probably a lot of things.\n\n``librxvm`` Regular Expression Syntax\n-------------------------------------\n\nA regular expression consists of ordinary characters and special characters.\nAn ordinary character matches itself exactly (e.g. the expression ``abc``\nmatches only the input string ``abc``).\n\nFull grammar rules can be seen `here \u003chttps://github.com/eriknyquist/regexvm/blob/master/tests/grammar.txt\u003e`_.\n\n|\n\nA description of the available special characters follows.\n\n\n    +---------+-----------------------+---------------------------------------+\n    |*Symbol* | *Name*                | *Description*                         |\n    +=========+=======================+=======================================+\n    | **+**   | one or more           | matches one or more of the preceding  |\n    |         |                       | character or parenthesis group, e.g.  |\n    |         |                       | the expression ``ab+`` matches the    |\n    |         |                       | input ``ab``, ``abb``, but not ``a``  |\n    +---------+-----------------------+---------------------------------------+\n    | **\\***  | zero or more          | matches zero or more of the preceding |\n    |         |                       | character or parenthesis group, e.g.  |\n    |         |                       | the expression ``ab*`` matches the    |\n    |         |                       | input ``a``, ``ab`` and ``abb``       |\n    +---------+-----------------------+---------------------------------------+\n    | **?**   | zero or one           | matches zero or one of the preceding  |\n    |         |                       | character or parenthesis group, e.g   |\n    |         |                       | the expression ``ab?`` matches only   |\n    |         |                       | ``a`` or ``ab``                       |\n    +---------+-----------------------+---------------------------------------+\n    | **{n}** | repetition            | matches **n** repetitions of the      |\n    |         |                       | preceding character or parenthesis    |\n    |         |                       | group.                                |\n    +---------+-----------------------+---------------------------------------+\n    |**{n,m}**| repetition (range)    | matches **n** to **m** repetitions of |\n    |         |                       | the preceding character or parenthesis|\n    |         |                       | group.                                |\n    +---------+-----------------------+---------------------------------------+\n    | **{,m}**| repetition (less)     | matches **m** or fewer repetitions of |\n    |         |                       | the preceding character or parenthesis|\n    |         |                       | group                                 |\n    +---------+-----------------------+---------------------------------------+\n    | **{n,}**| repetition (more)     | matches **n** or more repetitions of  |\n    |         |                       | the preceding character or parenthesis|\n    |         |                       | group                                 |\n    +---------+-----------------------+---------------------------------------+\n    | **|**   | alternation           | allows either the preceding or the    |\n    |         |                       | following expression to match, e.g.   |\n    |         |                       | the expression ``(c|h)at`` matches    |\n    |         |                       | ``cat`` and ``hat``                   |\n    +---------+-----------------------+---------------------------------------+\n    | **.**   | any                   | matches any character                 |\n    +---------+-----------------------+---------------------------------------+\n    | **^**   | start anchor          | by default, matches immediately       |\n    |         |                       | following the beginning of the input  |\n    |         |                       | string. If the RXVM_MULTILINE flag    |\n    |         |                       | is set, then it also matches          |\n    |         |                       | immediately following each newline    |\n    |         |                       | character                             |\n    +---------+-----------------------+---------------------------------------+\n    | **$**   | end anchor            | by default, matches immediately       |\n    |         |                       | preceding the end of the input string |\n    |         |                       | or newline character at the end of the|\n    |         |                       | input string. If the RXVM_MULTILINE   |\n    |         |                       | flag is set, then it also matches     |\n    |         |                       | immediately preceding each newline    |\n    |         |                       | character                             |\n    +---------+-----------------------+---------------------------------------+\n    | **( )** | parenthesis group     | Groups together individual characters |\n    |         |                       | or subexpressions, e.g. ``a(bc)+``    |\n    |         |                       | matches ``abcbc`` or ``abcbcbcbc``,   |\n    |         |                       | but not ``a``. Parenthesis groups can |\n    |         |                       | contain any expression, and can be    |\n    |         |                       | nested.                               |\n    +---------+-----------------------+---------------------------------------+\n    | **[ ]** | character class       | matches a single character inside     |\n    |         |                       | the brackets. Characters can be       |\n    |         |                       | escaped, (e.g. to match a literal     |\n    |         |                       | ``\"[\"`` or ``\"]\"`` character), or part|\n    |         |                       | of a range. Ranges are valid in both  |\n    |         |                       | valid in both directions, e.g.        |\n    |         |                       | ``Z-A`` describes the same set of     |\n    |         |                       | characters as ``A-Z``                 |\n    +---------+-----------------------+---------------------------------------+\n    |**[^ ]** | negated character     | matches a single character *not*      |\n    |         | class                 | inside the brackets. Otherwise, the   |\n    |         |                       | same character class rules apply      |\n    +---------+-----------------------+---------------------------------------+\n    | **\\\\**  | escape                | used to remove special meaning from   |\n    |         |                       | characters, e.g. to match a literal   |\n    |         |                       | ``*`` character                       |\n    +---------+-----------------------+---------------------------------------+\n\n|\n\nInstallation\n------------\n\nInstalling librxvm as a python module\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nJust use the included ``setup.py`` file to compile \u0026 install ``librvm`` as a\npython module:\n\n::\n\n    python setup.py build\n    python setup.py install\n\n`Full documentation for the librxvm python API can be found\nhere \u003chttps://github.com/eriknyquist/regexvm/blob/master/pyrxvm/README.rst\u003e`_\n\nInstalling librxvm as a C library\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Dependencies:**\n\n#. GNU Make\n#. GNU Autotools\n#. A C compiler (GCC, Clang)\n#. Some kind of libc (requires ``stdio.h``, ``stdlib.h``, ``stdint.h`` and\n   ``string.h``)\n\nTo install, do the usual stuff:\n::\n\n    ./autogen.sh\n    ./configure\n    make\n    sudo make install\n\nThe resulting static library ``librxvm.a`` will be installed in\n``/usr/local/lib`` by default. With the default configuration (i.e. everything\nturned on), the compiled library is about 54K on my 64-bit system. If you want\nto shave off ~40% of this size (around 20K in my case), you can configure with\nthe ``--disable-extras`` flag (see `Reference: optional features`_).\n\nBuilding C code with librxvm\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nOnce librxvm is installed, you can use it by adding\n``#include \u003clibrxvm/rxvm.h\u003e`` to your program, and then passing ``-lrxvm`` when\nlinking. For example:\n::\n\n    gcc my_rxvm_program.c -lrxvm\n\n\nExample applications\n--------------------\n\nSee sample code in the ``examples`` directory. The examples are simple, and\ncompile into easy-to-use command-line programs. They are automatically built by\nthe top-level Makefile when you run ``make`` to build ``librxvm``.\n\n``rxvm_match``\n^^^^^^^^^^^^^^\nAccepts two arguments, a regular expression and an input\nstring. Prints a message indicating whether the input string matches the\nexpression or not.\n\n::\n\n   $\u003e examples/rxvm_match\n\n     Usage: rxvm_match \u003cregex\u003e \u003cinput\u003e\n\n   $\u003e examples/rxvm_match \"[Rr]x(vm|VM){3,6}\" \"rxvm\"\n\n     No match.\n\n   $\u003e examples/rxvm_match \"[Rr]x(vm|VM){3,6}\" \"rxVMvmVM\"\n\n     Match!\n\n``rxvm_search``\n^^^^^^^^^^^^^^^\nAccepts two arguments, a regular expression and an input\nstring. Prints any instances of the regular expression that occur inside the\ninput string.\n\n::\n\n   $\u003e examples/rxvm_search\n\n     Usage: rxvm_search \u003cregex\u003e \u003cinput\u003e\n\n   $\u003e examples/rxvm_search \"rx(vm)*\" \"------------rx---------\"\n\n     Found match: rx\n\n   $\u003e examples/rxvm_search \"rx(vm)*\" \"------rxvm-------rxvmvm----\"\n\n     Found match: rxvm\n     Found match: rxvmvm\n\n``rxvm_fsearch``\n^^^^^^^^^^^^^^^^\n\nAccepts two arguments, a regular expression and a filename.\nPrints any instances of the regular expression that occur inside the file.\n\n::\n\n   $\u003e examples/rxvm_fsearch\n\n     Usage: rxvm_fsearch \u003cregex\u003e \u003cfilename\u003e\n\n   $\u003e echo \"------rxvm-------rxvmvm----\" \u003e file.txt\n   $\u003e examples/rxvm_fsearch \"rx(vm)*\" file.txt\n\n     Found match: rxvm\n     Found match: rxvmvm\n\n``rxvm_gen``\n^^^^^^^^^^^^\nAccepts one argument, a regular expression. Generates a\npseudo-random string which matches the expression.\n\n::\n\n   $\u003e examples/rxvm_gen\n\n     Usage: rxvm_gen \u003cregex\u003e\n\n   $\u003e examples/rxvm_gen \"([Rr]+(xv|XV)mm? ){2,}\"\n\n     rRrrRrrxvmm rxvmm rrRrrrRXVm Rrxvm rrRRrXVmm RXVmm\n\n   $\u003e examples/rxvm_gen \"([Rr]+(xv|XV)mm? ){2,}\"\n\n     Rxvm rrrxvmm RXVm RRxvmm\n\n|\n\nReference: core features\n------------------------\n\n``rxvm_compile``\n^^^^^^^^^^^^^^^^\n\n.. code:: c\n\n   int rxvm_compile (rxvm_t *compiled, char *exp);\n\nCompiles the regular expression ``exp``, and places the resulting VM\ninstructions into the ``rxvm_t`` type pointed to by ``compiled``.\n\n|\n\n**Return value**\n\n* 0 if compilation succeeded\n* negative number if an error occured (See `rxvm_compile error codes`_) and\n  `General error codes`_)\n\n|\n\n|\n\n``rxvm_match``\n^^^^^^^^^^^^^^\n\n.. code:: c\n\n   int rxvm_match (rxvm_t *compiled, char *input, int flags);\n\nChecks if the string ``input`` matches the compiled expression ``compiled``\nexactly.\n\n|\n\n**Return value**\n\n* 1 if the input matches the expression\n* 0 if the input doesn't match the compiled expression\n* negative number if an error occured (See `General error codes`_)\n\n|\n\n|\n\n``rxvm_search``\n^^^^^^^^^^^^^^^\n\n.. code:: c\n\n   int rxvm_search (rxvm_t *compiled, char *input, char **start, char **end, int flags);\n\nSearches the string starting at ``input`` for a pattern that matches the\ncompiled regular expresssion ``compiled``, until a match is found or until the\nstring's null termination character is reached. When a match is found,\nthe pointers pointed to by ``start`` and ``end`` are pointed at the first and\nlast characters of the matching substring. If no match is found, then both\n``start`` and ``end`` are set to ``NULL``.\n\n|\n\n**Return value**\n\n* 1 if a match is found\n* 0 if no match is found\n* negative number if an error occured (See `General error codes`_)\n\n|\n\n|\n\n``rxvm_free``\n^^^^^^^^^^^^^\n\n.. code:: c\n\n   void rxvm_free (rxvm_t *compiled);\n\nFrees all dynamic memory associated with a compiled ``rxvm_t`` type. Always\ncall this function, before exiting, on any compiled ``rxvm_t`` types.\n\n|\n\n**Returns** nothing.\n\n|\n\n|\n\nReference: optional features\n----------------------------\n\nThe following functions ``rxvm_fsearch``, ``rxvm_gen`` and ``rxvm_print``\nare compiled in by default. However, if you don't need them and you want the\nfinal library to be a bit smaller, you can exlude them by passing the\n``--disable-extras`` flag to the ``configure`` script, e.g.\n\n|\n\n|\n\n\u003e  ``./configure --disable-extras``\n\n|\n\n|\n\n``rxvm_fsearch``\n^^^^^^^^^^^^^^^^\n\n.. code:: c\n\n   int rxvm_fsearch (rxvm_t *compiled, FILE *fp, uint64_t *match_size, int flags);\n\nSearches the file at ``fp`` (``fp`` must be initialised by the caller, e.g. via\n``fopen``) for a pattern that matches the compiled regular expresssion\n``compiled``, from the current file position until EOF. If a match is found,\nthe file pointer ``fp`` is re-positioned to the first character of the match,\nand ``match_size`` is populated with a positive integer representing the match\nsize (number of characters). If no match is found, then ``match_end`` is set to\n0, and ``fp`` remains positioned at EOF.\n\nThis function uses an implementation of the Boyer-Moore-Horspool (BMH) algorithm\nto search the file for a pattern, and can be extremely fast. Because the\nBMH algorithm only works with fixed strings, this function uses a special\nheuristic to identify subtrings of fixed literal characters in your expression,\nand uses the fast BMH algorithm to search for these smaller substrings. If one\nis found, the virtual machine is invoked (needed to match a regular expression,\nbut slower).\n\nThis means the type of expression you write can significantly affect the speed\nof the ``rxvm_search`` function. Specifically, **longer** strings means\n**faster** matching.\n\n\n**Return value**\n\n* 1 if a match is found\n* 0 if no match is found\n* negative number if an error occured (See `rxvm_fsearch error codes`_ and\n  `General error codes`_)\n\n|\n\n|\n\n``rxvm_gen``\n^^^^^^^^^^^^\n\n.. code:: c\n\n   char *rxvm_gen (rxvm_t *compiled, rxvm_gencfg_t *cfg);\n\nGenerates a string of random characters that matches the compiled expression\n``compiled`` (``compiled`` must be initialised by the caller first, e.g. via\n``rxvm_compile``).\n\nThe ``rxvm_gencfg_t`` type provides some control over the randomness:\n\n.. code:: c\n\n   struct rxvm_gencfg {\n       uint8_t generosity;\n       uint8_t whitespace;\n       uint64_t limit;\n\n       uint64_t len;\n   };\n\n* ``generosity``: This value is expected to be between 0-100, and represents the\n  probability out of 100 that a ``+`` or ``*`` operator will match again\n  (\"greedyness\" in reverse). Higher means more repeat matches.\n* ``whitespace``: This value is expected to be between 0-100, and represents the\n  probability that a whitespace character will be used instead of a visible\n  character, when the expression allows it (e.g. when the expression contains a\n  \".\" metacharacter). Higher means more whitespace.\n* ``limit``: This value represents the generated input string size at which the\n  generation process should stop. This is not hard limit on the size of the\n  generated string; when the generated string reaches a size of ``limit``, then\n  ``generosity`` is effectively set to 0, and generation will stop at the\n  earliest possible opportunity, while also ensuring that the generated string\n  matches the pattern ``compiled``.\n* ``len``: If ``rxvm_gen`` returns a valid (non-null) pointer, then ``len`` will\n  contain the number of characters in the generated string (excluding the\n  terminating null-character).\n\nIf a null pointer is passed instead of a valid pointer to a ``rxvm_gencfg_t``\ntype, then default values are used.\n\n**Return value**\n\nA pointer to a heap allocation that contains a null-terminated random\nmatching string. If memory allocation fails, a null pointer is returned.\n\n|\n\n|\n\n\n``rxvm_print``\n^^^^^^^^^^^^^^\n\n.. code:: c\n\n   void rxvm_print (rxvm_t *compiled)\n\nPrints a compiled expression in a human-readable format.\n\n**Returns** nothing.\n\n|\n\n|\n\nConstants\n---------\n\nFlags\n^^^^^\n\n``rxvm_match`` and ``rxvm_search`` take a ``flags`` parameter. You can use\nthe masks below to set bit-flags which will change the behaviour of these\nfunctions (combine multiple flags by bitwise OR-ing them together):\n\n|\n\n``RXVM_ICASE``\n##############\n\ncase insensitive: ignore case when matching alphabet characters. Matching is\ncase-sensitive by default.\n\n``RXVM_NONGREEDY``\n##################\n\nnon-greedy matching: by default, the operators ``+``, ``*``, and ``?`` will\nmatch as many characters as possible, e.g. running ``rxvm_search`` with\nthe expression ``\u003c.*\u003e`` against the input string ``\u003ctag\u003ename\u003ctag\u003e`` will match\nthe entire string. With this flag set, it will match only ``\u003ctag\u003e``.\n\n``RXVM_MULTILINE``\n##################\n\nMultiline: By default, ``^`` matches immediately following the start of input,\nand ``$`` matches immediately preceding the end of input or the newline before\nthe end of input. With this flag set, ``^`` will also match immediately\nfollowing each newline character, and ``$`` will also match immediately\npreceding each newline character. This flag is ignored and automatically\nenabled when ``rxvm_match`` is used; since ``rxvm_match`` effectively\nrequires a matching string to be anchored at both the start and end of input,\nthen ``^`` and ``$`` are only useful if they can also act as line anchors.\n\nGeneral error codes\n^^^^^^^^^^^^^^^^^^^\n\nThe following error codes are returned by all ``librxvm`` functions\n\n|\n\n``RXVM_EMEM``\n#############\n\nIndicates that memory allocation failed.\n\n|\n\n``RXVM_EPARAM``\n###############\n\nIndicates that an invalid parameter (e.g. a ``NULL`` pointer) was passed to a\n``librxvm`` library function.\n\n|\n\n``rxvm_compile`` error codes\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe following error codes are returned only by the ``rxvm_compile`` function\n\n|\n\n``RXVM_BADOP``\n##############\n\nIndicates that an operator (``*``, ``+``, ``?``, ``{}``) was used incorrectly\nin the input expression, i.e. without a preceding literal character.\n\n|\n\nExample expressions: ``ab++``, ``{5}``.\n\n|\n\n``RXVM_BADCLASS``\n#################\n\nIndicates that an unexpected (and unescaped) character class closing character\n(``]``) was encountered in the input expression.\n\n|\n\nExample expressions: ``xy]``, ``[a-f]]``\n\n|\n\n``RXVM_BADREP``\n###############\n\nIndicates that an unexpected (and unescaped) repetition closing character\n(``}``) was encountered in the input expression.\n\n|\n\nExample expressions: ``a}``, ``bb{4,}}``\n\n|\n\n``RXVM_BADPAREN``\n#################\n\nIndicates that an unexpected (and unescaped) closing parenthesis character\n(``)``) was encountered in the input expression.\n\n|\n\nExample expressions: ``qy)``, ``q*(ab))``\n\n|\n\n``RXVM_EPAREN``\n###############\n\nIndicates that an unterminated parenthesis group (``()``) was encountered in\nthe input expression.\n\n|\n\nExample expressions: ``d+(ab``, ``((ab)``\n\n|\n\n``RXVM_ECLASS``\n###############\n\nIndicates that an unterminated character class (``[]``) was encountered in\nthe input expression.\n\n|\n\nExample expressions: ``[A-Z``, ``[[A-Z]``\n\n|\n\n``RXVM_EREP``\n#############\n\nIndicates that an unterminated repetition (``{}``) was encountered in\nthe input expression.\n\n|\n\nExample expressions: ``ab{5``, ``((ab)``\n\n|\n\n``RXVM_ERANGE``\n###############\n\nIndicates that an incomplete character range inside a character class was\nencountered in the input expression.\n\n|\n\nExample expressions: ``[A-]``, ``[-z]``\n\n|\n\n``RXVM_ECOMMA``\n###############\n\nIndicates that an invalid extra comma inside a repetition was encountered in\nthe input expression.\n\n|\n\nExample expressions: ``ab{5,,}``, ``x{6,7,8}``\n\n|\n\n``RXVM_EDIGIT``\n###############\n\nIndicates that an invalid character (i.e. not a digit or a comma) inside a\nrepetition was encountered in the input expression.\n\n|\n\nExample expressions: ``ab{3,y}``, ``b{8.9}``\n\n|\n\n``RXVM_MREP``\n#############\n\nIndicates that an empty repetition (``{}``) was encountered in\nthe input expression.\n\n|\n\nExample expressions: ``ab{}``, ``ab{,}``\n\n|\n\n``RXVM_ETRAIL``\n###############\n\nIndicates that a trailing escape character (``\\\\``) was encountered in\nthe input expression.\n\n|\n\nExample expressions: ``ab\\\\``, ``\\\\*\\\\``\n\n|\n\n``RXVM_EINVAL``\n###############\n\nIndicates that an invalid symbol (any character outside the supported\ncharacter set) was encountered in the input expression.\n\n|\n\n``rxvm_fsearch`` error codes\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe following error codes are returned only by the ``rxvm_fsearch`` function\n\n|\n\n``RXVM_IOERR``\n##############\n\nIndicates that an error occured while attempting to read from the passed\n``FILE`` pointer\n\n|\n\nTest Suite\n----------\n\nTo run the tests, use the ``check`` target in the main Makefile\n::\n\n    make check\n\nYou can also run the tests through Valgrind (if installed) to check for memory\nleaks or other issues in ``librxvm``, using the separate Makefile provided\nspecifically for this purpose, ``memcheck.mk``\n\nNOTE: Running the tests through Valgrind can take a very long time to complete\n\n::\n\n    make -f memcheck.mk\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriknyquist%2Flibrxvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feriknyquist%2Flibrxvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriknyquist%2Flibrxvm/lists"}