parsecsv / parsecsv-for-php

CSV data parser for PHP.
MIT License
678 stars 176 forks source link

Documentation on MySQL Regex Capabilities #214

Open alexstandiford opened 1 year ago

alexstandiford commented 1 year ago

Hello there! Thanks for making this, and if you're reading this I appreciate your contributions!

I am implementing this project in a CSV importer utility here, and I managed to figure out how to use the MySQL-like syntax that is referenced here.

However, I noticed that details of this capability isn't documented anywhere, and it took me a bit of effort to parse the regex to understand exactly what format was expected. I was using id=1 for a while before I realized it should be id = 1.

I think it would be good to add a section to the documentation that details how this works, ideally with some examples on how to use each one. I'd be happy to write this up, but I'm hoping someone with some context can help me along. I see there are many operations available, but I'm not entirely sure exactly how to use each one.

gogowitsch commented 1 year ago

Thanks for your feedback. I am sorry you lost time.

I think a heading under the “Example Usage“ section of the README.md is a good place to put your gotcha about missing spaces. Also, living examples can go into the “examples“ sub directory. Have a look at https://github.com/parsecsv/parsecsv-for-php/blob/main/examples/conditions.php, maybe you can extend that one. Pull requests are welcome.