GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
RGXG_UTILS_ESCAPE_STRING(3) librgxg manual RGXG_UTILS_ESCAPE_STRING(3)

rgxg_utils_escape_string - escape the given string for use in a regular expression

#include <rgxg/utils.h>
int rgxg_utils_escape_string (const char *src, size_t size,
char *regex, rgxg_options_t options);

rgxg_utils_escape_string() generates the (extended) regular expression that matches at most size bytes (or up to the first null byte) of the given string src, by escaping the regular expression special characters. src must be valid and not NULL.

The generated regular expression is written to the character string regex, including the terminating null byte ('\0'), unless RGXG_NONULLBYTE is set. If regex is NULL the return value is the number of characters (excluding the terminating null byte) that would have been written in case regex has been initialized. Note that the functions assume an arbitrarily long regex string, callers must ensure that the given string is large enough to not overflow the actual space.

options is either zero, or set to the following macro:

RGXG_NONULLBYTE
Do not add the terminating null byte ('\0') to the regex string.

rgxg_utils_escape_string() returns the number of characters (excluding the terminating null byte) written to regex.

This function is available since rgxg 0.1.

regex(7), rgxg_utils_alternation(3).

Hannes von Haugwitz <hannes@vonhaugwitz.com>
April 12, 2020 rgxg 0.1.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.