Needing some regexp help.

edited September 22 in Style Development [?]
I want to create a style for Google Mail's mobile interface. This normally would not be a big deal if it were not for the fact this address changes every single time.

So right, the address I've been going to is m.gmail.com. This loads a simplified UI I'd like to adjust except every time it resolves to a unique URL, like this;
https://mail.google.com/mail/u/0/x/7omz1reb1nj4-/?f=1

Worse still, before -/? the code can either be twelve or thirteen digits long.

What do I put in as the regexp I am trying to effect?!

Comments

  • This should do it: https?:\/\/(m\.gmail|mail\.google)\.com(\/.*)?

    If you want to learn and/or play with regexp, this is really a great tool. It also links to your specific regexp.
    https://www.debuggex.com/r/HaZJaJAkI6EuHFWp

  • I think your version @Vednoc also targets the normal desktop version, not only mobile.

    As I don't have a test account here, it would be good if you gave us at least three links that should be targeted (the ones google redirects you to) and three that should not be targeted (desktop version) so we might figure out if there is a consistent scheme to distinguish them.
  • edited September 25 [?]

    https://mail.google.com/mail/mu/mp/555/#tl/Received = mobile chrome /firefox

    555 possible is random.

  • @krystian3w That looks different from the url OP wrote in his first post.

    Just to be clear, if you want to design a mobile style on your desktop pc, you probably have to change your UserAgent and window size, otherwise google will know you're on a desktop PC and probably redirect you to a desktop page.
  • edited September 29 [?]

    As for me, changing the user agent only is enough and I do not have to tilt the window / use responsive mode (Ctrl + Shift + M).

Sign In or Register to comment.