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

Question - How to match All chars except Newline? #392

Closed
mitnk opened this issue May 7, 2019 · 4 comments
Closed

Question - How to match All chars except Newline? #392

mitnk opened this issue May 7, 2019 · 4 comments

Comments

@mitnk
Copy link
Contributor

mitnk commented May 7, 2019

Hi, I want to match any chars except the newline char, like [^\n]+ in regex. How could I achieve this in pest?

Here is what I want to parse: https://pest.rs/?bin=ehhze#editor

@mitnk
Copy link
Contributor Author

mitnk commented May 7, 2019

Got answer from gmatht@Gitter. It's { (!NEWLINE ~ ANY)+ }. Full example here

@mitnk mitnk closed this as completed May 7, 2019
@birkenfeld
Copy link
Contributor

@dragostis In general, would it be useful to have a more intuitive "except" syntax? I've needed something like this twice now, and had to think "is this really the best way" each time.

@mitnk
Copy link
Contributor Author

mitnk commented May 7, 2019

Non-intuitive is not the problem. The problem I think is not fully described in docs/books. Not having a good doc is the main issue of most Rust projects :)

(I want to add a line to the book, but the book repo itself does not have a good readme to me to follow)

@dragostis
Copy link
Contributor

I'm sorry that the other repos do not have contributing/building docs. :(

I think pest's level of documentation is good. All the features are there with examples; the issue is that there are no involved examples in the form of tutorials.

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

3 participants