Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to change syntax flags & Generex extensibility #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HawkSK
Copy link

@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
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.

1 participant