Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| libregex [2017/04/20 04:27] – KyleEvans | libregex [2022/08/15 06:31] (current) – Fix BSDgrep link KubilayKocak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== libregex ====== | + | ===== libregex ===== |
| ===== Problem ===== | ===== Problem ===== | ||
| - | libgnuregex will be going away, and it would be great if [[BSDgrep|bsdgrep]] can again grow the capacity to handle GNU extensions. As far as I've found, the GNU extensions add: | + | |
| + | libgnuregex will be going away, and it would be great if [[KyleEvans/BSDgrep|bsdgrep]] can again grow the capacity to handle GNU extensions. As far as I've found, the GNU extensions add: | ||
| * Empty subexpressions/ | * Empty subexpressions/ | ||
| * Missing quantifiers to BREs: \?, \+ | * Missing quantifiers to BREs: \?, \+ | ||
| Line 14: | Line 17: | ||
| * \`: start of subject string | * \`: start of subject string | ||
| * \': end of subject string | * \': end of subject string | ||
| + | |||
| ===== Motivation ===== | ===== Motivation ===== | ||
| - | As previously mentioned, libgnuregex and [[BSDgrep|bsdgrep]] could use GNU extensions. '' | + | |
| + | As previously mentioned, libgnuregex and [[KyleEvans/BSDgrep|bsdgrep]] could use GNU extensions. '' | ||
| ===== Implementation Details ===== | ===== Implementation Details ===== | ||
| + | |||
| As of right now, I have floated two patches around freebsd-hackers@. Patch [1] is what implementing the GNU extensions on top of the current Spencer implementation would look like. It still has some bugs/kinks that need to be worked out, but it does generally work for less torturous use cases. This also includes a REG_POSIX flag so that one may turn off all extensions by default. | As of right now, I have floated two patches around freebsd-hackers@. Patch [1] is what implementing the GNU extensions on top of the current Spencer implementation would look like. It still has some bugs/kinks that need to be worked out, but it does generally work for less torturous use cases. This also includes a REG_POSIX flag so that one may turn off all extensions by default. | ||
| Line 31: | Line 37: | ||
| [2] [[https:// | [2] [[https:// | ||
| + | |||
| ===== Preparation / Intermediate Steps ===== | ===== Preparation / Intermediate Steps ===== | ||
| + | |||
| There are basically two intermediate steps that need to be taken: | There are basically two intermediate steps that need to be taken: | ||
| + | |||
| - A patch needs to be introduced to put an end to the different instances of escaping an ordinary character and expecting an ordinary character. This is undefined behavior by POSIX standards, so we should start throwing errors for it. This is mostly so that we can use \b, | - A patch needs to be introduced to put an end to the different instances of escaping an ordinary character and expecting an ordinary character. This is undefined behavior by POSIX standards, so we should start throwing errors for it. This is mostly so that we can use \b, | ||
| + | |||
| - The above [2] patch, libregex.diff, | - The above [2] patch, libregex.diff, | ||
| ===== Discussion ===== | ===== Discussion ===== | ||
| + | |||
| To represent points from previous discussions: | To represent points from previous discussions: | ||
| **Backreferences will enforce that EREs, like BREs, may sometimes require exponential time to match.** | **Backreferences will enforce that EREs, like BREs, may sometimes require exponential time to match.** | ||
| This is true. It would first require people/ | This is true. It would first require people/ | ||
| + | |||
| + | ===== Feedback? ===== | ||
| + | |||
| + | Please do give feedback on this idea, as it has had relatively little. If by e-mail, please do make sure to CC the listed email address for KyleEvans. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | {{tag> | ||