Regex matching not working #1938

Open
opened 2025-11-26 23:02:16 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @Araxeus on GitHub (Jul 18, 2024).

Bitwarden Beta

  • I'm using the new native Bitwarden Beta app and I'm aware that legacy .NET app bugs should be reported in bitwarden/mobile

Steps To Reproduce

I have tested 2 different regexes on different domains, both work on web, and with the old android version, but fail on beta build

  1. Create a regex URI matcher
  2. navigate to a matching page with a login form

Expected Result

autocomplete works

Actual Result

autocomplete doesnt work

Screenshots or Videos

No response

Additional Context

No response

Build Version

2024.7.1-beta (18876)

Environment Details

  • Device: Xiaomi Poco F3
  • OS Version: HyperOS 1.0.1.0

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
Originally created by @Araxeus on GitHub (Jul 18, 2024). ### Bitwarden Beta - [X] I'm using the new native Bitwarden Beta app and I'm aware that legacy .NET app bugs should be reported in [bitwarden/mobile](https://github.com/bitwarden/mobile) ### Steps To Reproduce I have tested 2 different regexes on different domains, both work on web, and with the old android version, but fail on beta build 1. Create a regex URI matcher 2. navigate to a matching page with a login form ### Expected Result autocomplete works ### Actual Result autocomplete doesnt work ### Screenshots or Videos _No response_ ### Additional Context _No response_ ### Build Version 2024.7.1-beta (18876) ### Environment Details - Device: Xiaomi Poco F3 - OS Version: HyperOS 1.0.1.0 ### Issue Tracking Info - [X] I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
GiteaMirror added the app:password-managerbug labels 2025-11-26 23:02:16 -06:00
Author
Owner

@sammbw commented on GitHub (Jul 18, 2024):

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below. If you are able to provide the regex you used, as well as an example URL, that would be very helpful!

Thanks!

@sammbw commented on GitHub (Jul 18, 2024): Hi there, I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below. If you are able to provide the regex you used, as well as an example URL, that would be very helpful! Thanks!
Author
Owner

@Araxeus commented on GitHub (Jul 19, 2024):

Ok the exact regex that doesnt work for me is ^https:\/\/operate-pr-\d+\.onrender\.com\/login$
ill once again say it works on all apps but the android beta

here is the exact setup:

{
  Website: "https://operate.onrender.com/",
  URI: "^https:\/\/operate-pr-\d+\.onrender\.com\/login$"
}

if i go to https://operate-pr-12.onrender.com/login it doesnt match ONLY on the android beta

the regex match PR urls made by render - see https://docs.render.com/pull-request-previews / https://github.com/Araxeus/opl-whatsapp-server/pull/12#issuecomment-2231745315

(those -pr- .onrender websites go to sleep after 15min of unused, and it takes 2min to wakeup if it was asleep when you make a request or navigate to it)

@Araxeus commented on GitHub (Jul 19, 2024): Ok the exact regex that doesnt work for me is `^https:\/\/operate-pr-\d+\.onrender\.com\/login$` ill once again say it works on all apps but the android beta here is the exact setup: ```js { Website: "https://operate.onrender.com/", URI: "^https:\/\/operate-pr-\d+\.onrender\.com\/login$" } ``` if i go to `https://operate-pr-12.onrender.com/login` it doesnt match ONLY on the android beta > the regex match PR urls made by render - see https://docs.render.com/pull-request-previews / https://github.com/Araxeus/opl-whatsapp-server/pull/12#issuecomment-2231745315 (those `-pr- .onrender` websites go to sleep after 15min of unused, and it takes 2min to wakeup if it was asleep when you make a request or navigate to it)
Author
Owner

@Araxeus commented on GitHub (Aug 2, 2024):

On Chrome (desktop with extension):

image

On Android Beta:

Screenshot_2024-08-02-17-15-30-264_com.x8bit.bitwarden.beta.jpg

@Araxeus commented on GitHub (Aug 2, 2024): On Chrome (desktop with extension): ![image](https://github.com/user-attachments/assets/6b44b07a-aeee-43b0-9af0-8ea077591437) On Android Beta: ![Screenshot_2024-08-02-17-15-30-264_com.x8bit.bitwarden.beta.jpg](https://github.com/user-attachments/assets/5e6b991b-d293-4951-950f-e015522b928a)
Author
Owner

@Araxeus commented on GitHub (Aug 2, 2024):

ok well I just realized whats causing this issue:

  • the android beta is trying to match only the exact domain without path (https://operate-pr-25.onrender.com)
  • while the chrome extension match the exact page url (https://operate-pr-25.onrender.com/login)
  • theres also the android non-beta variant which acts the weirdest - it matches any login for the Base Domain not including subdomain aka .onrender.com (which doesnt makes sense really)

This is still a bug IMO because users would expect the android app and the browser extension to behave the same way

I've fixed the issue for my usecase by making the /login part at the end optional in the regex:

^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?$

for the record both the chrome extension and the android app have default URI match set to "Base domain" but it shouldn't matter
image


another weird thing is that the android app tries to match the domain name without / at the end,
aka https://operate-pr-25.onrender.com (path doesnt matter because of bug above)

while if you go on your browser to https://operate-pr-25.onrender.com, the extension tries to match https://operate-pr-25.onrender.com/ (with a / at the end) which can also breaks regex logic

to account for that behavior I would have to add another \/? at the end of the regex, aka:
^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?\/?$

@Araxeus commented on GitHub (Aug 2, 2024): ok well I just realized whats causing this issue: * the android beta is trying to match only the exact domain without path (`https://operate-pr-25.onrender.com`) * while the chrome extension match the exact page url (`https://operate-pr-25.onrender.com/login`) * theres also the android non-beta variant which acts the weirdest - it matches any login for the Base Domain not including subdomain aka `.onrender.com` (which doesnt makes sense really) This is still a bug IMO because users would expect the android app and the browser extension to behave the same way I've fixed the issue for my usecase by making the `/login` part at the end optional in the regex: ``` ^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?$ ``` ---- > for the record both the chrome extension and the android app have default URI match set to "Base domain" but it shouldn't matter ![image](https://github.com/user-attachments/assets/4adbde06-9c8a-40ec-b40f-92eb533de8ee) ---- > another weird thing is that the android app tries to match the domain name without `/` at the end, aka `https://operate-pr-25.onrender.com` (path doesnt matter because of *bug* above) > > while if you go on your browser to `https://operate-pr-25.onrender.com`, the extension tries to match `https://operate-pr-25.onrender.com/` (with a `/` at the end) which can also breaks regex logic > > to account for that behavior I would have to add another `\/?` at the end of the regex, aka: > `^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?\/?$`
Author
Owner

@segln commented on GitHub (Oct 30, 2024):

I've fixed the issue for my usecase by making the /login part at the end optional in the regex:

^https://operate-pr-\d+.onrender.com(?:/login)?$

Thank you for sharing a temporary solution. I'm experiencing same issues with this bug.

@segln commented on GitHub (Oct 30, 2024): > I've fixed the issue for my usecase by making the /login part at the end optional in the regex: > > ^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?$ Thank you for sharing a temporary solution. I'm experiencing same issues with this bug.
Author
Owner

@benkap commented on GitHub (Dec 18, 2024):

When using a custom port number the workaround does not work (and neither does Host, Base-Domain, Starts-with, Exact, or Regular expression) on Andriod client

@benkap commented on GitHub (Dec 18, 2024): When using a custom port number the workaround does not work (and neither does `Host`, `Base-Domain`, `Starts-with`, `Exact`, or `Regular expression`) on Andriod client
Author
Owner

@vincentkoevoets commented on GitHub (Jan 4, 2025):

That's a +1 for me. I have not found a single consistent way of matching on both Chrome on desktop and Android. It's frustrating. I found out that on Chrome on Android, the http(s):// of my urls seems to be cut of by Chrome. So, I thought regex is the way to go. This matches on desktop:
(http(s)?\:\/\/)?10\.50\.30\.1\:29546.* but not on Android. Notice the http(s):// is already optional to account for the behaviour on Android. Many of my services run on the same IP but on a different port, so I see no other way of matching. "Starts with" also does not work just like the rest mentioned by @benkap. Other issues about the same problem seem to bleed to death, so I hope this one will get noticed by the devs.

@vincentkoevoets commented on GitHub (Jan 4, 2025): That's a +1 for me. I have not found a single consistent way of matching on both Chrome on desktop and Android. It's frustrating. I found out that on Chrome on Android, the http(s):// of my urls seems to be cut of by Chrome. So, I thought regex is the way to go. This matches on desktop: ```(http(s)?\:\/\/)?10\.50\.30\.1\:29546.*``` but not on Android. Notice the http(s):// is already optional to account for the behaviour on Android. Many of my services run on the same IP but on a different port, so I see no other way of matching. "Starts with" also does not work just like the rest mentioned by @benkap. Other issues about the same problem seem to bleed to death, so I hope this one will get noticed by the devs.
Author
Owner

@vtruong68 commented on GitHub (Jan 17, 2025):

This is broken for me on Android as well. I use the regex 192.168.1.12[^:] to access my server without hitting other services on the server on other ports (e.g. 192.168.1.12:8080). This works fine on desktop but isn't picked up when I visit 192.168.1.12 on my phone.

@vtruong68 commented on GitHub (Jan 17, 2025): This is broken for me on Android as well. I use the regex `192.168.1.12[^:]` to access my server without hitting other services on the server on other ports (e.g. `192.168.1.12:8080`). This works fine on desktop but isn't picked up when I visit `192.168.1.12` on my phone.
Author
Owner

@lk-vila commented on GitHub (Jul 3, 2025):

What bothers me is the different behavior between the matching on the android app and on the browser extension.

I use regex because when I set the URI to domain.com, I want it to suggest the password if I enter domain.com or sub.domain.com, and when I set the URI to sub.domain.com, I want it to suggest it only when I enter sub.domain.com. Host option makes the first case not work and Base domain option makes the second case not work. I really think there should be an option for it, as it's a really simple and desirable behavior, but there isn't so I use regex.

The things is that, on the browser, if I set the URI to domain.com it'll match both domain.com and sub.domain.com. If I set it to sub.domain.com it'll match only sub.domain.com. This is great, it's simple and it works. But on android, it only works if I set it to .*domain\.com.* and .*sub.domain\.com.*. I know, this is regex, but the problem is that I came from KeePass, where the matching I explained was the default behavior, and I have 400+ entries already, which I would need to edit to make it work on android.

I think the regex matching on android should work like the browser extension one does or, better yet, there should be an autofill option for the behavior I explained above.

@lk-vila commented on GitHub (Jul 3, 2025): What bothers me is the different behavior between the matching on the android app and on the browser extension. I use regex because when I set the URI to `domain.com`, I want it to suggest the password if I enter _domain.com_ or _sub.domain.com_, and when I set the URI to `sub.domain.com`, I want it to suggest it only when I enter _sub.domain.com_. Host option makes the first case not work and Base domain option makes the second case not work. I really think there should be an option for it, as it's a really simple and desirable behavior, but there isn't so I use regex. The things is that, on the browser, if I set the URI to `domain.com` it'll match both _domain.com_ and _sub.domain.com_. If I set it to `sub.domain.com` it'll match only _sub.domain.com_. This is great, it's simple and it works. But on android, it only works if I set it to `.*domain\.com.*` and `.*sub.domain\.com.*`. I know, this is regex, but the problem is that I came from KeePass, where the matching I explained was the default behavior, and I have 400+ entries already, which I would need to edit to make it work on android. I think the regex matching on android should work like the browser extension one does or, better yet, there should be an autofill option for the behavior I explained above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#1938