- Save Regexctrl+s
- Go to library entry

- PCRE2 (PHP >=7.3)
- PCRE (PHP <7.3)
- ECMAScript (JavaScript)
- Python
- Golang
- Java 8

- Match
- Substitution
- List
- Unit Tests

Sponsor

Jamstack at Scale

"

^(http[s]?:\/\/)?([^:\/\s]+)(:([^\/]*))?(\/\w+\.)*([^#?\s]+)(\?([^#]*))?(#(.*))?$

"

i

^ asserts position at start of the string

1st Capturing Group

(http[s]?:\/\/)?

? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

http

matches the characters http literally (case insensitive)Match a single character present in the list below

[s]

? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

s matches the character s with index 115_{10} (73_{16} or 163_{8}) literally (case insensitive)

: matches the character : with index 58_{10} (3A_{16} or 72_{8}) literally (case insensitive)

\/ matches the character / with index 47_{10} (2F_{16} or 57_{8}) literally (case insensitive)

\/ matches the character / with index 47_{10} (2F_{16} or 57_{8}) literally (case insensitive)

2nd Capturing Group

([^:\/\s]+)

Match a single character not present in the list below

[^:\/\s]

+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

: matches the character : with index 58_{10} (3A_{16} or 72_{8}) literally (case insensitive)

\/ matches the character / with index 47_{10} (2F_{16} or 57_{8}) literally (case insensitive)

\s matches any whitespace character (equivalent to [\r\n\t\f\v ])

3rd Capturing Group

(:([^\/]*))?

? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

: matches the character : with index 58_{10} (3A_{16} or 72_{8}) literally (case insensitive)

4th Capturing Group

([^\/]*)

Match a single character not present in the list below

[^\/]

* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

\/ matches the character / with index 47_{10} (2F_{16} or 57_{8}) literally (case insensitive)

5th Capturing Group

(\/\w+\.)*

* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you're not interested in the data

\/ matches the character / with index 47_{10} (2F_{16} or 57_{8}) literally (case insensitive)

\w

matches any word character (equivalent to [a-zA-Z0-9_])+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case insensitive)

6th Capturing Group

([^#?\s]+)

Match a single character not present in the list below

[^#?\s]

+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

#?

matches a single character in the list #? (case insensitive)\s matches any whitespace character (equivalent to [\r\n\t\f\v ])

7th Capturing Group

(\?([^#]*))?

\? matches the character ? with index 63_{10} (3F_{16} or 77_{8}) literally (case insensitive)

8th Capturing Group

([^#]*)

Match a single character not present in the list below

[^#]

* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

# matches the character # with index 35_{10} (23_{16} or 43_{8}) literally (case insensitive)

9th Capturing Group

(#(.*))?

# matches the character # with index 35_{10} (23_{16} or 43_{8}) literally (case insensitive)

10th Capturing Group

(.*)

.

matches any character (except for line terminators)* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)

Global pattern flags

i modifier: **i**nsensitive. Case insensitive match (ignores case of [a-zA-Z])

Your regular expression does not match the subject string.

No Match

r"

"

i

Please wait while the app is loading...