Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6139249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:57:57+00:00 2026-05-23T17:57:57+00:00

I have following JS regex which breaks the code and not working as it

  • 0

I have following JS regex which breaks the code and not working as it should.

var loginFailedRegex = /https:\/\/encore.lsbu.ac.uk\/iii\/cas\/login;jsessionid=[a-z0-9]*?service=https%3A%2F%2Flispac.lsbu.ac.uk%3A443%2Fpatroninfo~S1%2FIIITICKET/i;

if (loginFailedRegex.text(decodeURI(loc))) {
   zoomPagePortion(100, 100);
}

The loginFailedRegex has only [a-z0-9]* as regex and other whole string is static.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:57:58+00:00Added an answer on May 23, 2026 at 5:57 pm

    I think the regex problem is here

    [a-z0-9]*?
    

    you should probably have

    [a-z0-9]*\?
    

    Assuming that ? is a literal in the URL that you are looking for you need to escape it in your regex.

    Also you need to change text to test assuming that is not just a typo in your post.

    var loginFailedRegex = /https:\/\/encore.lsbu.ac.uk\/iii\/cas\/login;jsessionid=[a-z0-9]*\?service=https%3A%2F%2Flispac.lsbu.ac.uk%3A443%2Fpatroninfo~S1%2FIIITICKET/i;
    
    if (loginFailedRegex.test(decodeURI(loc))) {
       zoomPagePortion(100, 100);
    }
    

    Here is a test page to verify

    http://jsfiddle.net/cordsen/uVnZz/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which works in FF / Chrome var stack =
I have the following regex: (?<=\.\d+?)0+(?=\D|$) I'm running it against a string which contains
I have the following regex which suppose to match email addresses: [a-z0-9!#$%&'*+\\-/=?^_`{|}~][a-z0-9!#$%&'*+\\-/=?^_`{|}~.]{0,63}@[a-z0-9][a-z0-9\\-]*[a-z0-9](\\.[a-z0-9][a-z0-9\\-]*[a-z0-9])+$. I have
I have following input: MaintanceGie?\195?\159mannFlock SupportGie?\195?\159mannFlock ABCSaskDgfskSblabla And search for a regex which gives
I am white-belt regex. I have the following regex which sort of works except
I have the following regex: regex = compile(((?P<lastyear>[\dBFUPR]+)/)*((?P<lastseason>[\dBFUPR]+))*(^|-(?P<thisseason>[\dBFUPR]*))) Which I am using to process
I have a Regex which contains the following .Is this suitable restricting the user
I have this phone number: +44 (0) 1234 123456 which the following regex is
I have the following string, which matches the following RegEx string. I would like
I have the following regex pattern which works fine: #^(.+?)=(.+?)$#D However I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.