DEV Community

Discussion on: My Misconception when Learning Web Dev

Collapse
 
c_v_ya profile image
Constantine

Well, now I know that regexp works faster! Thank you :) And I wish you strength to continue your dev path, it gets better and much more interesting.

Collapse
 
reinhart1010 profile image
Reinhart Previano K.

Though that regexp may not be faster (in terms of performance, compared with creating own loops and conditions), regexp is more efficient to use for comparing (using str.match() etc.) and extracting parts of strings (thanks to capture groups / {}). I also recommend learning regex as it can be used outside JavaScript such as PHP, Java, Swift, and even Python.

Collapse
 
c_v_ya profile image
Constantine

I actually never thought of using regexp even in python to comparing, before reading about example in this article. Though they are not an easy thing to master, I agree that it's a useful thing in many ways!