I've been taking a break from coding as I need to focus on my exams. I haven't finished them yet so I'm still not fully focusing on the 100DaysOfCode challenge. Still, I wanted to do some coding to not let all my skills rust away.
Today I read the rest of chapter 9 of EJS and did some freeCodeCamp challenges.
- Using regular expressions more efficiently
- How INI files are structured
- Using regex
Task 'Reading_EJS'. Elapsed time: 30 min 45 s
Task 'FCC'. Elapsed time: 25 min 31 s
If you want a way to test your regular expressions I recommend these two sites:
I preferer the Regexpal as it's easier for me to understand
If you are wondering what are the most popular programming languages you can check this video from Tech with Tim.
"Regular expressions are objects that represent patterns in strings. They use their own language to express these patterns.
A regular expression has a method test to test whether a given string matches it. It also has a method exec that, when a match is found, returns an array containing all matched groups. Such an array has an index property that indicates where the match started.
Strings have a match method to match them against a regular expression and a search method to search for one, returning only the starting position of the match. Their replace method can replace matches of a pattern with a replacement string or function.
Regular expressions can have options, which are written after the closing slash. The i option makes the match case insensitive. The g option makes the expression global, which, among other things, causes the replace method to replace all instances instead of just the first. The y option makes it sticky, which means that it will not search ahead and skip part of the string when looking for a match. The u option turns on Unicode mode, which fixes a number of problems around the handling of characters that take up two code units.
Regular expressions are a sharp tool with an awkward handle. They simplify some tasks tremendously but can quickly become unmanageable when applied to complex problems. Part of knowing how to use them is resisting the urge to try to shoehorn things that they cannot cleanly express into them."
End of summary. You can find the original text from here
Thank you and see you all next time!