Skip to content

Commit

Permalink
regexp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ostapenko committed Oct 24, 2023
1 parent db0b408 commit f776b30
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/wpt-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ jobs:
if [ $start_index -gt -1 ]; then
# Initialize an array for URLs
declare -a URLS
url_pattern="^(http|https|ftp)://[a-zA-Z0-9.-]+(\.[a-zA-Z]{2,4})(/[a-zA-Z0-9_.-]+)*(\/?)(\?[a-zA-Z0-9_.-]+=[a-zA-Z0-9%_.-]+)*$"
url_pattern="((http|https|ftp):\/\/[a-zA-Z0-9.-]+(\.[a-zA-Z]{2,4})(\/[a-zA-Z0-9_.-]+)*(\/?)(\?[a-zA-Z0-9_.-]+=[a-zA-Z0-9%_.-]+)*(\#?)([a-zA-Z0-9%_.-=]+)*)"
for ((i=start_index; i<${#lines[@]}; i++)); do
url="${lines[$i]}"
# Remove any extra characters or spaces
url="${url//[- ]/}"
if [[ $url =~ $url_pattern ]]; then
URLS+=("$url")
if [[ ${lines[$i]} =~ $url_pattern ]]; then
URLS+=("${BASH_REMATCH[1]}")
fi
done
Expand Down

0 comments on commit f776b30

Please sign in to comment.