DEV Community

Discussion on: Code Validation

Collapse
 
anshbansal profile image
Aseem Bansal

Are you trying to do this to learn?

If no, there are linters and formatters for almost every language in which you can put the rules for this to be done.

If yes, what have you tried so far? I mean because you are trying this to learn it would not be a good if someone gives you the answers directly. Trying to figure out solutions to problems is where you actually learn. If you have no idea maybe search how linters and formatters work. That can be a starting point.

Collapse
 
ankitbeniwal profile image
Ankit Beniwal • Edited

Yes trying to learn. I am currently thinking about regex.

Is there any other method? or should I just dive in.

Collapse
 
anshbansal profile image
Aseem Bansal

Unless you are very good at regex try just using string methods and usual data structures. You don't want to spend time learning regex as well as about formatters.

Make one of them your goal - regex or formatter. It would reduce the learning curve.

Thread Thread
 
ankitbeniwal profile image
Ankit Beniwal

Very well. Thanks!