Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Some regex expressions aren't supported #801

Closed
ghost opened this issue Mar 25, 2019 · 3 comments
Closed

Some regex expressions aren't supported #801

ghost opened this issue Mar 25, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 25, 2019

Bug Report

Steps to Reproduce:

  1. Create a profile with the following with any of the following in a matchingRegex constraint
    1. Negative Lookahead
    2. Negative Lookbehind
    3. Lookahead
    4. Lookbehind
  2. Ensure there is no ofLength, shorterThan or longerThan constraint included for the field
  3. Ensure there is an ofType string constraint
  4. Run the generator in random mode

Expected Result:

Strings should be created that match the given regular expression, adhering to the (negative) look ahead/behind.

Actual Result:

The lookahead/lookbehind statement is treated as a literal and included in the output, rather than whitelisting/blacklisting the permitted strings.

e.g.

{
  "field": "first-name",
  "is": "matchingRegex",
  "value": "^(?!ignoreme)([a-z0-9]+)$"
},

emits the following data:

first-name
?!ignoreme1
?!ignoreme714msv5o4y7
?!ignoremepa3
?!ignoremekq
?!ignoreme66w45
?!ignoreme1y6
?!ignoreme5io5m
?!ignoremesq
?!ignoremem
?!ignoreme9mw

Additional Context:

This may require an update to the Automaton library - #537

@ghost ghost added bug Something isn't working data-type:string labels Mar 25, 2019
@pdaulbyscottlogic
Copy link
Contributor

This seems more like a feature request to me

@ghost
Copy link
Author

ghost commented Mar 29, 2019

Treating as a non-bug, but documentation should be updated to clarify that these regular expression features aren't supported.

@ghost ghost removed the bug Something isn't working label Mar 29, 2019
@harry-bedford harry-bedford reopened this Apr 1, 2019
@harry-bedford
Copy link
Contributor

harry-bedford commented Apr 1, 2019

closed/opened by mistake

@harry-bedford harry-bedford reopened this Apr 1, 2019
@ghost ghost self-assigned this Apr 2, 2019
@ghost ghost mentioned this issue Apr 2, 2019
@ghost ghost closed this as completed in #842 Apr 2, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants