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)$
/?
ensures/
matched 0 or 1 time, making optional
Comments
Post a Comment