T
T
toha_man2018-08-25 12:06:02
Regular Expressions
toha_man, 2018-08-25 12:06:02

How to use a quantifier in a REGEXP group?

Why is it not possible to use such a construction?
(?<=https?).*
I want to match both http://blabla.com and http s ://blabla.com

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2018-08-25
@Rsa97

Why do you need a lookbehind for a simple match?
https?.*

N
Nick Sdk, 2018-08-31
@lidacriss

Why is it not possible to use such a construction?
Because in the "back looking" there should be a clear number of characters
in https?it turns out either 5 (https) or 4 (http)
https://regex101.com/r/tOiEx1/1
will be like 2 options for "back looking"
but, as I wrote earlier Rsa97 , in your case you don't need it)
quite simplyhttps?.*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question