Skip to content

Ability to change syntax flags & Generex extensibility#55

Merged
mifmif merged 2 commits into
mifmif:masterfrom
HawkSK:master_mifmif_change_syntax_flags
Feb 27, 2026
Merged

Ability to change syntax flags & Generex extensibility#55
mifmif merged 2 commits into
mifmif:masterfrom
HawkSK:master_mifmif_change_syntax_flags

Conversation

@HawkSK
Copy link
Copy Markdown
Contributor

@HawkSK HawkSK commented Aug 1, 2020

Motivation

Have you ever wondered why the characters @&<#~ behave very weirdly in generex? Yes, Generex does use this regex grammar and not the Java one we all are used to, so these are special characters. Fear no more: we can actually turn off the syntax flags on the RegExp!

Features

  • adds the possibility to define different syntax flags for the input regex by overloading the constructor & createRegExp()
  • changes static methods (createRegExp, requote) to protected, so they can be reused in subclasses (typically in the constructor)
  • change regExp, automaton fields to protected, subclasses will surely appreciate it

All of these changes are backwards-compatible, because only new overloaded methods are added and the default behaviour is preserved. Also changing stuff from private to protected is OK because it is less restrictive now.


Disclaimer: This branch is not compilable right now because of maven error

Source option 5 is no longer supported. Use 6 or later.

PR #48 does a good job of updating the project and my original feature branch https://github.com/HawkSK/Generex/tree/change_syntax_flags was built upon #48, so pull that branch if you want to try this feature. This PR is only the separate independent feature in Generex class.
Note: I used new version 1.0.4 because 1.0.3 is used in #48.

HawkSK added 2 commits August 1, 2020 19:28
- add possibility to define different syntax flags for the regex by overloading the constructor & createRegExp()
- change static methods (createRegExp, requote) to protected, so they can be reused in subclasses (typically in the constructor)
- change regExp, automaton fields to protected
@mifmif mifmif merged commit a274748 into mifmif:master Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants