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

Empty and Union #13

Open
GoogleCodeExporter opened this issue Dec 29, 2015 · 0 comments
Open

Empty and Union #13

GoogleCodeExporter opened this issue Dec 29, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. make a regex containing a union with an empty string e.g. "|a" "a|" or "a||b"
2. create a Xeger object with this regex, 
3. Using the Xeger object, create an instance of this regex.

What is the expected output? What do you see instead?
The expected output is either an empty string, or a valid string from the union.
Xeger will raise a parse error or produce the wrong output: it seems '|' is 
read as a normal character.

What version of the product are you using? On what operating system?
The latest version of Xeger.
On windows 7, service pack 1.

Please provide any additional information below.
See Unit tests attached to this issue for examples and expectations (as set by 
the build-in regex matching functionality of java).

A workaround of this bug is as follows:
replace all occurrences of "|" by "()|()" before passing your regex to Xeger.

Original issue reported on code.google.com by [email protected] on 30 Jun 2014 at 6:54

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant