PATMATCH(3)

πŸ“¦
version 2022.10.16 Β· 2 versions
, in opensuse-leap 16.0

πŸ’… PATMATCH(3) β€” SchilyΒ΄s LIBRARY FUNCTIONS 🌸

okay so bestie, welcome to patmatch(3) β€” the little function that checks a string for matches, and yes, we're gonna get into all of it. no cap. 🫢


✨ NAME ✨

patmatch() β€” checks string for matches πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

char *patmatch(pattern, aux, string, soff, slen, alt, state)
     char *pattern;
     int *aux;
     char *string;
     int soff;
     int slen;
     int alt;
     int state[];

πŸ¦‹ DESCRIPTION πŸ¦‹

patmatch() uses the pattern matching information pattern and in addition aux and alt β€” which were previously set up by a call to patcompile(3) β€” to check string for a match. The length of the string is slen, and the starting index used for matching is soff. The string can also be terminated by a null byte. πŸŽ€

The state array is set up and used internally by patmatch and should have at least strlen(pattern) + 1 elements. periodt. πŸ‘‘


🌈 RETURNS 🌈

Returns a NULL pointer if the string starting at the specified offset did not match the pattern. πŸ’€

Any non-NULL return is a pointer to the first character of string after the part that matches. slay. ✨


πŸ”₯ SEE ALSO πŸ”₯

  • patcompile(3) for information on aux and alt.
  • And match(1) for a description ot the regular expressions. iykyk πŸ‘€

🧚 NOTES 🧚

The pattern matching functions are based on ones presented by Martin Richards in "A Compact Function for Regular Expression Pattern Matching", Software-Practice and Experience vol 9, 527-534 (1979). iconic source material, fr fr. πŸ“šπŸ’œ


xoxo, Joerg Schilling 🫢 Β· 2022/09/09 Β· SchilyΒ΄s LIBRARY FUNCTIONS πŸ’–

πŸ“¦ where this page comes from