Regex YouTube channel link

I’m looking for a Javascript regex which is able to extract the channel identifier of a YouTube channel link. I’ve found some solutions on Stackoverflow but I’m still missing a solution which is also capable to work with the YouTube channel alias (e.g. https://www.youtube.com/@youtubecreators) So the regex should be able to match following URLs: https://www.youtube.com/c/coca-cola… Read More Regex YouTube channel link

Why are backslashes matched by character classes not containing them in Regular Expressions?

I am trying to match an alphanumeric String in PHP 8.2 using preg_match. $str = ‘\\\\’; echo preg_match("/^[A-z0-9]*$/", $str); The output of the following code is 1, indicating that the pattern matches the subject. How is it possible, that the character class [A-z0-9] matches the backslashes, which are not contained in it? >Solution : Your… Read More Why are backslashes matched by character classes not containing them in Regular Expressions?

Struggle to match multiple same occurence after one specific character chain REGEX

Thanks to anyone that will try to help me. I struggle into making a regex that can do this case : I want every match of "Heure Pleine Saison Basse" that occur after the first occurence of "Acheminement conso". Using the raw text below, i want to match "Heure Pleine Saison Basse" 3 4 5 6 7 and not 1 &… Read More Struggle to match multiple same occurence after one specific character chain REGEX

Regex to select two spaces between words (or two spaces before a letter)

I’m cleaning up some ancient HTML help files and there are a lot of double-spaces that I’d like to clean up (replace each double-space with single). Sample: <li><b>% Successful</b>. The percentage of jobs that returned a confirmation.</li> I want to find double-spaces only before the start of sentences or between words (so between the setting… Read More Regex to select two spaces between words (or two spaces before a letter)

Regex to split on new lines with a pattern

I am trying to split a string into multiple strings (like observations). For example, a sample text with 3 "bidder id" observations is: BID RANK BID TOTAL BIDDER ID BIDDER INFORMATION (NAME/ADDRESS/LOCATION) ——– ———– ——— ————————————————- 1 1,486,399.87 5 ORTIZ ASPHALT PAVING INC 909 386-1200 SB PREF CLAIMED 00814766 P O BOX 883 FAX 909… Read More Regex to split on new lines with a pattern

swift regex get certaint substrings in string

I have a string like this one and i want to get the text after src= to the end of .m3u8. Example: let string = "loremipsum-src=https://loremipsum.m3u8&pano-src=https://loremimpum.m3u8&proj" I want to get the substrings https://loremipsum.m3u8 This is what I am trying for now: let regex = try! NSRegularExpression(pattern: "src=(.*?).m3u8", options: .caseInsensitive) if let match = regex.firstMatch(in: string,… Read More swift regex get certaint substrings in string