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

/xml-regex Parsing XML with Regular Expressions #3

Open
flapenguin opened this issue Apr 23, 2020 · 2 comments
Open

/xml-regex Parsing XML with Regular Expressions #3

flapenguin opened this issue Apr 23, 2020 · 2 comments

Comments

@flapenguin
Copy link
Owner

https://flapenguin.me/xml-regex

@Kristine1975
Copy link

Kristine1975 commented Jul 6, 2021

Hello from two years later!
I don't think the following is quite correct: (?<attrvalue>[^\s"'>]+):

  • it doesn't allow for empty attribute values (+ instead of *)
  • it doesn't allow for spaces in attribute values
  • it doesn't allow for ' when the value's delimiter is " (if my reading of the XML spec is correct, " is the only allowed delimiter anyway)

@flapenguin flapenguin changed the title Parsing XML with Regular Expressions /xml-regex Parsing XML with Regular Expressions Jun 27, 2022
@flapenguin
Copy link
Owner Author

This regex was not intended to be a complete xml parser at any means. You can potentially extend it to conform to the spec. But honestly I don't think it worth the trouble.

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

No branches or pull requests

2 participants