pcre2_dfa_match.3 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. .TH PCRE2_DFA_MATCH 3 "16 October 2018" "PCRE2 10.33"
  2. .SH NAME
  3. PCRE2 - Perl-compatible regular expressions (revised API)
  4. .SH SYNOPSIS
  5. .rs
  6. .sp
  7. .B #include <pcre2.h>
  8. .PP
  9. .nf
  10. .B int pcre2_dfa_match(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP,
  11. .B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP,"
  12. .B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP,"
  13. .B " pcre2_match_context *\fImcontext\fP,"
  14. .B " int *\fIworkspace\fP, PCRE2_SIZE \fIwscount\fP);"
  15. .fi
  16. .
  17. .SH DESCRIPTION
  18. .rs
  19. .sp
  20. This function matches a compiled regular expression against a given subject
  21. string, using an alternative matching algorithm that scans the subject string
  22. just once (except when processing lookaround assertions). This function is
  23. \fInot\fP Perl-compatible (the Perl-compatible matching function is
  24. \fBpcre2_match()\fP). The arguments for this function are:
  25. .sp
  26. \fIcode\fP Points to the compiled pattern
  27. \fIsubject\fP Points to the subject string
  28. \fIlength\fP Length of the subject string
  29. \fIstartoffset\fP Offset in the subject at which to start matching
  30. \fIoptions\fP Option bits
  31. \fImatch_data\fP Points to a match data block, for results
  32. \fImcontext\fP Points to a match context, or is NULL
  33. \fIworkspace\fP Points to a vector of ints used as working space
  34. \fIwscount\fP Number of elements in the vector
  35. .sp
  36. For \fBpcre2_dfa_match()\fP, a match context is needed only if you want to set
  37. up a callout function or specify the heap limit or the match or the recursion
  38. depth limits. The \fIlength\fP and \fIstartoffset\fP values are code units, not
  39. characters. The options are:
  40. .sp
  41. PCRE2_ANCHORED Match only at the first position
  42. PCRE2_COPY_MATCHED_SUBJECT
  43. On success, make a private subject copy
  44. PCRE2_ENDANCHORED Pattern can match only at end of subject
  45. PCRE2_NOTBOL Subject is not the beginning of a line
  46. PCRE2_NOTEOL Subject is not the end of a line
  47. PCRE2_NOTEMPTY An empty string is not a valid match
  48. .\" JOIN
  49. PCRE2_NOTEMPTY_ATSTART An empty string at the start of the subject
  50. is not a valid match
  51. .\" JOIN
  52. PCRE2_NO_UTF_CHECK Do not check the subject for UTF
  53. validity (only relevant if PCRE2_UTF
  54. was set at compile time)
  55. .\" JOIN
  56. PCRE2_PARTIAL_HARD Return PCRE2_ERROR_PARTIAL for a partial
  57. match even if there is a full match
  58. .\" JOIN
  59. PCRE2_PARTIAL_SOFT Return PCRE2_ERROR_PARTIAL for a partial
  60. match if no full matches are found
  61. PCRE2_DFA_RESTART Restart after a partial match
  62. PCRE2_DFA_SHORTEST Return only the shortest match
  63. .sp
  64. There are restrictions on what may appear in a pattern when using this matching
  65. function. Details are given in the
  66. .\" HREF
  67. \fBpcre2matching\fP
  68. .\"
  69. documentation. For details of partial matching, see the
  70. .\" HREF
  71. \fBpcre2partial\fP
  72. .\"
  73. page. There is a complete description of the PCRE2 native API in the
  74. .\" HREF
  75. \fBpcre2api\fP
  76. .\"
  77. page and a description of the POSIX API in the
  78. .\" HREF
  79. \fBpcre2posix\fP
  80. .\"
  81. page.