regexmatch.dev
Explore
Open main menu
Save & Share
Facebook
Twitter
Tumblr
E-Mail
Pinterest
LinkedIn
Reddit
csv split, accounting for 'sub-csv' groups inside brackets
Published on Tue Mar 01 2022
This came up as a need for splitting a url param into an array ofr stings, where such a string may be a sublist contained within a bracket pair
Regex
Test String
&relations=categories.materials.(frbr_equivilents,list_alternatives,tags,ratings),descendants,ancestors
Additional matching regexes for
csv split, accounting for 'sub-csv' groups inside brackets
csv split, accounting for 'sub-csv' groups inside brackets
This came up as a need for splitting a url param into an array ofr stings, where such a string may be a sublist contained within a bracket pair
Find PHP object variables
Find PHP object variables, and replace them with (array)brackets.
full url dissection
any given url inside a text will be recognized and split into different groups: - url (full url) - scheme - hostname (subdomain + domain + tld) - port - path - query (GET-parameters) while the only group required for a match is the hostname, therefore `example.com` would allready be a match.
Duration with mandatory 'm'
Parses date-time duration strings [+-][P]1y2M3d4h5m6s, where 'm' is the dafault. Like this, where {} contains list of capturing groups: 21 - parsed as {,,,,21,} 2y2s - parsed as {2,,,,,2}
Array formatting (serialized)
Check for correctly formatted array of this type: array( array('name'=>'War and Peace', 'year'=>1865), array('name'=>'Different Seasons', 'year'=>1982), )
replace between brackets 3
replace multiple matches of words in brackets with no brackets
Array formating
Check for correctly formatted array of this type: array(1,2,3,)
Array formating (serialized)
Check for correctly formatted array of this type: array('a', 'bb', 'ccccc',)
Get Content within brackets
Get Content within brackets
Simple email splitter
Split the email and get the user and domain.