Quantcast
Viewing all articles
Browse latest Browse all 1719

General • Re: Regex issue (MultinameSearch)

But a super-fast search doesn't involve many steps, you just need to instantly combine the names in one or 2 steps, and then within seconds have the results in MasterSeeker, without having to add yet another command (typing) in Everything.
As simple as possible.

Script python:
import re

Code:

import re# Ścieżka do pliku z nazwami piosenekfile_path = 'nazwy_piosenek.txt'# Otwórz plik i wczytaj nazwy piosenekwith open(file_path, 'r', encoding='utf-8') as file:    file_names = [line.strip() for line in file if line.strip()]# Połącz nazwy piosenek w regexregex_pattern = "|".join(re.escape(name) for name in file_names)# Utwórz finalne wyrażenie regularnefinal_regex = f"^(?!.*({regex_pattern})$).*[b] ANY NAME ARTIST.[/b]*\.mp3$"print(final_regex)

Step 1: Prepare the file names_songs.txt
Create a text file names_songs.txt and put all the song names in it, each on a new line:
XXXX

Step 2: Run the Python script
Run the following Python script in the folder where the file names_songs.txt is located:
XXXXX


Result
After running the above script, it will display the final regular expression that you can use to search for the corresponding files:
XXXX

But it's still a lot of steps with the script, don't want to play around in the text editor every time to create the necessary regex with names+one artist

Statistics: Posted by Debugger — Tue Apr 23, 2024 6:30 pm



Viewing all articles
Browse latest Browse all 1719

Trending Articles