FEN Regex

Published on Tue Mar 01 2022

This will match an FEN string (https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation). It is not strict in having each rank separated by a '\' character, although it is strict in the order of characters for the Castling section. Anything not following the order of KQkq in the case where castling is available, will fail the Regex. It is also case sensitive for the Side and the "en passant" column letter.

Additional matching regexes for
FEN Regex

FEN Regex

This will match an FEN string (https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation). It is not strict in having each rank separated by a '\' character, although it is strict in the order of characters for the Castling section. Anything not following the order of KQkq in the case where castling is available, will fail the Regex. It is also case sensitive for the Side and the "en passant" column letter.

Simple Best URL Regex Match

# Best URL Regex to match URL, This is simple and can match 64K of url regex under 20ms ## Regex Matches All Below and more: - https://example.domain - http://example.domain - //example.domain - //example.com - https://example.com:34 - //example.com:23 - example.com

Wikipedia anchor

Match Wikipedia anchor dot-instead-of-percent encoding string.replace(/((?:\.[a-f0-9]{2}){2})/ig, function(match) { return decodeURIComponent(match.replace(/\./g, '%')) });

Full Best URL Regex Match

# Best Full URL Regex to match URL, This is simple and can match 64K of url regex under 77ms ## Regex Matches All Below and more: - https://example.domain - http://example.domain - //example.domain - //example.com - https://example.com:34 - //example.com:23 - example.com

Email validation

because everything else is too strict

RFC1918 - Private IPv4 addresses

Validate a given IP v4 address against all three defined Private IPv4 Subnets as statet in RFC1918 - 10.0.0.0/8 - 172.16.0.0/20 - 192.168.0.0/16 [Wikipedia Link](https://en.wikipedia.org/wiki/Private_network) [RFC Link](https://doi.org/10.17487%2FRFC1918)

remove blank keys in query string

looks for blank keys in the query string and remove it, in order to make shorter request.

Capturing between phrases across multiple lines

Discussion https://www.reddit.com/r/regex/comments/kxtyl6/capturing_between_phrases_across_multiple_lines/ https://www.reddit.com/user/Pauley0/

yyyy-MM-dd hh:MM

date format for "yyyy-MM-dd hh:MM" valid strict model.

Match any url in text or html (http, https)

Match any url in text or html (http, https)