It's UWAweek 50

helpOSTS

This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 3 articles in this topic
Showing 3 of 445 articles.
Currently 1 other person reading this forum.


 UWA week 22 (1st semester, study break) ↓
SVG not supported

Login to reply

👍?
helpful

While 'sed -E' and 'grep -E' support the extended regular expressions (ERE), which is the RE syntax of awk, any reasons why we stick to the basic regular expressions (BRE)? Firstly, 'buy 1 get 3' is appealing because the ERE syntax works in these commands, reducing the cognitive load when learning and using. Secondly, regarding the portability, I do not have a clue about the targeted operating system or whether we will log in to an ancient machine. Since in Ubuntu 23.04, those commands support the ERE, I think it should run well on other UNIX-like systems having software updated. Thirdly, the BRE is a little counter-intuitive. For example, some meta characters like '?', and '+' have to be backslashed to become quantifiers, but '*' does not have to. Someone who has not read the manual may fall into this pitfall, not understanding what goes wrong.


SVG not supported

Login to reply

👍?
helpful

Because most courses are about learning old school things... And you are now studying at school :) They are not going to make you lose many marks in the final exam anyway. Why not just get prepared for the exam and forget about thing you do not like later.


SVG not supported

Login to reply

👍x1
helpful

"Junyu Zhang" <24*6*1*2@s*u*e*t*u*a*e*u*a*> wrote:
> While 'sed -E' and 'grep -E' support the extended regular expressions (ERE), which is the RE syntax of awk, any reasons why we stick to the basic regular expressions (BRE)? > > Firstly, 'buy 1 get 3' is appealing because the ERE syntax works in these commands, reducing the cognitive load when learning and using. > > Secondly, regarding the portability, I do not have a clue about the targeted operating system or whether we will log in to an ancient machine. Since in Ubuntu 23.04, those commands support the ERE, I think it should run well on other UNIX-like systems having software updated. > > Thirdly, the BRE is a little counter-intuitive. For example, some meta characters like '?', and '+' have to be backslashed to become quantifiers, but '*' does not have to. Someone who has not read the manual may fall into this pitfall, not understanding what goes wrong.
Hi Junyu, Fair question. The answer is that there, once again, a proliferation of RE sub-languages, so in the same way that the course standardised on Bash (which I don't actually use, preferring ksh), the rationale has all along been to go with the systems/tools that are most widely used and supported across a range of Unix/Linux variants. Portability is the key. Hence I aim to teach (and write) algorithmically efficient, but otherwise vanilla code. The other reason is pedagogic. While some people in the class have come to the unit with loads of experience, many (I suspect the vast majority) have little prior experience and find REs intimidating. One of the things you discover as a lecturer is that you have to teach the class where they are, not where you are. (To be utterly honest, even then I think I was pushing it for many in the class.) So, old school. Yup! Good luck in the exams! Cheers MichaelW 👨‍🎨

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy