Vb.net regex escaping optional backslash optional in the end of a string -


i have string , want know if includes pattern in end of it. want know if has "jobs" or "jobs/" "/" optional example:

www.example.jobs/ www.example.jobs

so far have this:

 \.(com|org|edu|net|jobs?/|gov)$ 

the problem if have string ends "jobs" doesn't catch it.

just add ? optional quantifier /

\.(com|org|edu|net|jobs?/?|gov)$ 

regex demo

  • /? ensures / matched 0 or 1 time, making optional

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -