0

I am trying to find if a particular string ends with only a specific word and no words are after that

strings i subjecting to searching:

1.) https://beta-qa.pearson.com/iie-api/courses/5daa3022e4b0ef7dce37acec/assignments

2.) https://beta-qa.pearson.com/iie-api/courses/5daa3022e4b0ef7dce37acec/assignments/984fa00d-d002-4826-80f4-76d1267e3aaa

What I want is to only get the string that ends with assignment (i.e. the first string from the above two examples)

This is the regexes I was using: *\[assignments]$, \assignments/$

This is not working this gives both results. How can I only filter the string that ends with assignments?

Can someone please help me?

Jananath Banuka
  • 493
  • 3
  • 11
  • 22

1 Answers1

0

The correct regexp for this is assignments$. It probably didn't work for you because you mixed / and \ in your last regex.

UPD: See an example on regex101.com

Pavel Lint
  • 3,252
  • 1
  • 18
  • 18