FAQ: Introduction to Regular Expressions - Literals

This community-built FAQ covers the “Literals” exercise from the lesson “Introduction to Regular Expressions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Practical Data Cleaning

FAQs on the exercise Literals

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

I am already stuck. They are explaining what a regex is but not how to write one. Therefore anything I type in the box doesn’t work because I don’t know how to actually write a regex.

2 Likes

The most basic regex is a literal.

acme

is a literal match for the word ‘acme’.

For this lesson we only need to type in a literal, and nothing else.

3 Likes

the codeacademy explains what it is but aren’t telling us how to write one and this is kind of tricky for me

https://s3.amazonaws.com/codecademy-content/courses/regex/literal just add key “literal” add end of url

Hi everyone, I got the key to the first and when I paste it at the end of https://content.codecademy.com/courses/regex/ , I just get the following error message:

404 Not Found

  • Code: NoSuchKey
  • Message: The specified key does not exist.
  • Key: courses/regex/index.html

Anyone has an idea what might be the issue? isn’t it supposed to be https://content.codecademy.com/courses/regex/keyHere ?

Thanks.

I got a code “on” and was told to put it at the end of the URL.
I got a 404 error and it won’t continue.
Probably didn’t get the instructions.
Can somebody pls help me

Hi everyone :slight_smile:

There seems to be a little confusion about the instructions given for the checkpoint, especially the last portion:

When you’ve entered a regular expression that matches the appropriate strings, a key will appear in the browser. Each key is part of a URL that contains a surprise you can uncover when you complete the lesson! Add the key to the end of the URL in the code editor and run the code to unlock the next exercise. Move to the next exercise when you are ready!

Which when done correctly (Spoilers - correct answer ahead!), will give you:

image

That portion gets added to https://content.codecademy.com/courses/regex/ => https://content.codecademy.com/courses/regex/on. As you finish the exercises in the lesson, you’ll continue to build out this URL and get rewarded with a nice little GIF at the end that lives in the full URL.

So the next exercise, you’ll get another word (it might be… dinosaur for example). So https://content.codecademy.com/courses/regex/on => https://content.codecademy.com/courses/regex/ondinosaur.

I hope that this post helps and I can play around with the wording in the actual checkpoint. Thanks everyone!

2 Likes

Edit 2: I think I get it now… the url is ONLY added in the code editor (before Run is used) not the address bar. Apologies, I think I’m tripping over the older instructions where the partial URL was used; it’s clear to me now.

Original:
If the intention is ONLY to use that URL at the very end of the course then the instructions should be updated to match this, the very first lesson says this-
“Add the key to the end of the URL in the code editor and run the code to unlock the next exercise”

Edit 1: Misread this the first time. If by play around with wording you mean that introduction is liable to change then I think that’ll stop folks running into the 404 issues. I believe it used to be necessary to actually enter that URL and run the code to advance in a lesson; if that’s no longer the case then those instructions are just a little dated.

1 Like

I don’t see what I should see in the browser because all I see is this:

Both Firefox and Safari show the same. Any idea anyone to solve this issue?

Thanks,
Dirk

1 Like

Hey everyone!
That’s what the browser displays:

1 Like

I have the same issue. Apparently the whole lesson is broken like this. And refreshing the page doesn’t help. I’ve submitted a bug on the lesson’s page. Hopefully they will fix this.

1 Like

hey @juliesovaa @ionpara @dradasew, thanks for flagging this. I just raised this to our curriculum team, specifically @realkennylin. I’ll report back once they have looked at it.

1 Like

Hi @juliesovaa, @ionpara, @dradasew!

I’m not sure how your mini-browsers ended up with that URL, maybe someone gimme more details to look into? I’d appreciate that :slight_smile:

The quick fix is to change the mini-browser’s URL to https://content.codecademy.com/courses/regex/build/index_all.html?query=0 (for the 2nd exercise)

Then if this error persists, for the 3rd exercise change the mini-browser’s URL to: https://content.codecademy.com/courses/regex/build/index_all.html?query=1 ← notice that I increased the # at the end by 1 and do this for the remaining exercises. I hope it doesn’t come to that, but this would be the more immediate fix.

I’ve tried accessing this lesson on both Chrome and Firefox and haven’t been able to replicate the issue. However, the URLs I provided should work.

If you guys have more details, again, I’d appreciate it. Thank you!!

1 Like

Hi realkennylin,

Thanks for looking into this. When I enter this page it still shows this URL in the mini browser (screenshot attached):

With the URL you provided I can now see what I should see, so it’s working for now. I’ll check later how the remainder of exercises in this lesson will work.

Thanks again,
Dirk

Hi realkennylin,

It remains the same with every other exercise in this - I have to manually paste in the URL you provided and increase the #. At least, I can continue with this lesson now.

Thank you,
Dirk

1 Like

Thanks for responding @dradasew!

I’m curious if you the browser had that URL when you first started the exercise or if you changed it somehow?

From my end, the URL looks to be configured correctly for new learners to the exercise but this might be a bigger bug that I could look into.

Appreciate your time and responses :slight_smile:

This has been the same from the very beginning - also the first time I got to that point in the lesson. And it actually took me while to understand that what I saw was not what I should have been seeing :blush: Only after I had seen a screenshot in this forum somewhere I was aware that there is something wrong on the page.

Thank you,
Dirk

1 Like

Hi @realkennylin!
It’s exactly the same for me as dradasew said. The URL I originally had in the first exercise was https://content.codecademy.com/?query=0. I didn’t change anything, it was like this from the start. I used the URL from your reply, and the exercise loaded correctly. But the next one has the same problem, so I guess I’ll have to use your URL for the remaining exercises in this lesson. What details could be useful to you?
Thank you for your time :slightly_smiling_face:

1 Like

Thanks @juliesovaa!

Maybe knowing what browser you used when accessing the lesson would be helpful.

Another thought that I have is that there might’ve been some engineering work done in that week that all three of you were accessing the lesson. But I’ll keep an eye out for bugs on this lesson :slight_smile: