robot icon indicating copy to clipboard operation
robot copied to clipboard

Fixing the invalid xref check

Open matentzn opened this issue 1 year ago • 1 comments

Resolves #1127

  • [X] docs/ have been added/updated
  • [x] tests have been added/updated
  • [X] mvn verify says all tests pass
  • [x] mvn site says all JavaDocs correct
  • [X] CHANGELOG.md has been updated

This PR fixing the regular expression used to recognise XREFs. I tested it in the https://regex101.com/ sandbox:

image

  • Match the prefix:
    • ^[A-Za-z_]: Starts with an alphabet letter (either uppercase or lowercase) or an underscore.
    • [A-Za-z0-9_.-]*: Followed by any number (including zero) of alphanumeric characters, underscores, periods, or hyphens.
    • [A-Za-z0-9_]: Ends the first part with an alphanumeric character or an underscore.
  • :: Contains a colon separating the prefix from the reference.
  • [^\\s]+$: Matches the reference, which comprises 1 or more characters that are not whitespace (including spaces, tabs, and newlines).

matentzn avatar Mar 10 '24 11:03 matentzn

I just updated the tests to illustrates that the new check works.

matentzn avatar Mar 12 '24 21:03 matentzn