|
1 |
| -Oniguruma API Version 6.9.3 2019/07/06 |
| 1 | +Oniguruma API Version 6.9.4 2019/09/30 |
2 | 2 |
|
3 | 3 | #include <oniguruma.h>
|
4 | 4 |
|
@@ -168,7 +168,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
168 | 168 | # int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
|
169 | 169 | OnigCompileInfo* ci, OnigErrorInfo* einfo)
|
170 | 170 |
|
171 |
| - This function is deprecate, and it does not allow the case where |
| 171 | + This function is deprecated, and it does not allow the case where |
172 | 172 | the encoding of pattern and target is different.
|
173 | 173 |
|
174 | 174 | Create a regex object.
|
@@ -306,6 +306,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
306 | 306 |
|
307 | 307 | normal return: match position offset (i.e. p - str >= 0)
|
308 | 308 | not found: ONIG_MISMATCH (< 0)
|
| 309 | + error: error code (< 0) |
309 | 310 |
|
310 | 311 | arguments
|
311 | 312 | 1 reg: regex object
|
@@ -342,7 +343,8 @@ Oniguruma API Version 6.9.3 2019/07/06
|
342 | 343 | Do not pass invalid byte string in the regex character encoding.
|
343 | 344 |
|
344 | 345 | normal return: match length (>= 0)
|
345 |
| - not match: ONIG_MISMATCH ( < 0) |
| 346 | + not match: ONIG_MISMATCH (< 0) |
| 347 | + error: error code (< 0) |
346 | 348 |
|
347 | 349 | arguments
|
348 | 350 | 1 reg: regex object
|
@@ -391,6 +393,136 @@ Oniguruma API Version 6.9.3 2019/07/06
|
391 | 393 | 7 callback_arg: optional argument passed to callback
|
392 | 394 |
|
393 | 395 |
|
| 396 | +# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[]) |
| 397 | + |
| 398 | + Create a regset object. |
| 399 | + All regex objects must have the same character encoding. |
| 400 | + All regex objects are prohibited from having the ONIG_OPTION_FIND_LONGEST option. |
| 401 | + |
| 402 | + arguments |
| 403 | + 1 rset: return address of regset object |
| 404 | + 2 n: number of regex in regs |
| 405 | + 3 regs: array of regex |
| 406 | + |
| 407 | + normal return: ONIG_NORMAL |
| 408 | + |
| 409 | + |
| 410 | +# int onig_regset_add(OnigRegSet* set, regex_t* reg) |
| 411 | + |
| 412 | + Add a regex into regset. |
| 413 | + The regex object must have the same character encoding with the regset. |
| 414 | + The regex object is prohibited from having the ONIG_OPTION_FIND_LONGEST option. |
| 415 | + |
| 416 | + arguments |
| 417 | + 1 set: regset object |
| 418 | + 2 reg: regex object |
| 419 | + |
| 420 | + normal return: ONIG_NORMAL |
| 421 | + |
| 422 | + |
| 423 | +# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg) |
| 424 | + |
| 425 | + Replace a regex in regset with another one. |
| 426 | + If the reg argument value is NULL, then remove at-th regex. (and indexes of other regexes are changed) |
| 427 | + |
| 428 | + arguments |
| 429 | + 1 set: regset object |
| 430 | + 2 at: index of regex (zero origin) |
| 431 | + 3 reg: regex object |
| 432 | + |
| 433 | + normal return: ONIG_NORMAL |
| 434 | + |
| 435 | + |
| 436 | +# void onig_regset_free(OnigRegSet* set) |
| 437 | + |
| 438 | + Free memory used by regset object and regex objects in the regset. |
| 439 | + If the same regex object is registered twice, the situation becomes destructive. |
| 440 | + |
| 441 | + arguments |
| 442 | + 1 set: regset object |
| 443 | + |
| 444 | + |
| 445 | +# int onig_regset_number_of_regex(OnigRegSet* set) |
| 446 | + |
| 447 | + Returns number of regex objects in the regset. |
| 448 | + |
| 449 | + arguments |
| 450 | + 1 set: regset object |
| 451 | + |
| 452 | + |
| 453 | +# regex_t* onig_regset_get_regex(OnigRegSet* set, int at) |
| 454 | + |
| 455 | + Returns the regex object corresponding to the at-th regex. |
| 456 | + |
| 457 | + arguments |
| 458 | + 1 set: regset object |
| 459 | + 2 at: index of regex array (zero origin) |
| 460 | + |
| 461 | + |
| 462 | +# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at) |
| 463 | + |
| 464 | + Returns the region object corresponding to the at-th regex. |
| 465 | + |
| 466 | + arguments |
| 467 | + 1 set: regset object |
| 468 | + 2 at: index of regex array (zero origin) |
| 469 | + |
| 470 | + |
| 471 | +# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos) |
| 472 | + |
| 473 | + Perform a search with regset. |
| 474 | + |
| 475 | + return value: |
| 476 | + normal return: index of match regex (zero origin) |
| 477 | + not found: ONIG_MISMATCH (< 0) |
| 478 | + error: error code (< 0) |
| 479 | + |
| 480 | + arguments |
| 481 | + 1 set: regset object |
| 482 | + 2 str: target string |
| 483 | + 3 end: terminate address of target string |
| 484 | + 4 start: search start address of target string |
| 485 | + 5 range: search terminate address of target string |
| 486 | + 6 lead: outer loop element |
| 487 | + ONIG_REGSET_POSITION_LEAD (returns most left position) |
| 488 | + ONIG_REGSET_REGEX_LEAD (returns most left position) |
| 489 | + ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex) |
| 490 | + 7 option: search time option |
| 491 | + ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line |
| 492 | + ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line |
| 493 | + 8 rmatch_pos: return address of match position (match_address - str) |
| 494 | + |
| 495 | + * ONIG_REGSET_POSITION_LEAD and ONIG_REGSET_REGEX_LEAD return the same result. |
| 496 | + These differences only appear in search time. |
| 497 | + In most cases, ONIG_REGSET_POSITION_LEAD seems to be faster. |
| 498 | + |
| 499 | + |
| 500 | +# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos) |
| 501 | + |
| 502 | + Perform a search with regset and match-params. |
| 503 | + |
| 504 | + return value: |
| 505 | + normal return: index of match regex (zero origin) |
| 506 | + not found: ONIG_MISMATCH (< 0) |
| 507 | + error: error code (< 0) |
| 508 | + |
| 509 | + arguments |
| 510 | + 1 set: regset object |
| 511 | + 2 str: target string |
| 512 | + 3 end: terminate address of target string |
| 513 | + 4 start: search start address of target string |
| 514 | + 5 range: search terminate address of target string |
| 515 | + 6 lead: outer loop element |
| 516 | + ONIG_REGSET_POSITION_LEAD (returns most left position) |
| 517 | + ONIG_REGSET_REGEX_LEAD (returns most left position) |
| 518 | + ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex) |
| 519 | + 7 option: search time option |
| 520 | + ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line |
| 521 | + ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line |
| 522 | + 8 mps: array of match-params |
| 523 | + 9 rmatch_pos: return address of match position (match_address - str) |
| 524 | + |
| 525 | + |
394 | 526 | # OnigRegion* onig_region_new(void)
|
395 | 527 |
|
396 | 528 | Create a region.
|
|
0 commit comments