Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.
static $regexp =
'/^(?# Assert start of Array Declaration
)(?:(?# Begin Comma Indented Sequence - Last sequence
wont have an ending comma
)ї\s]*("e;|\')ї^\1]*\1ї\s]*(?# Initial Quote Check. SubPattern 1 Used
)(?:=>(?# Arrow Sign. May not exist. If it does, parse a second one
)ї\s]*("e;|\')ї^\2]*\2ї\s]*)(?# End Second Quote Declaration
)(?:,ї\s]*|$)(?# Add a comma or assert the end of the pattern
))*(?# Continue Loop if end of line wasnt asserted
)$/';// Assert end of Regular Expression
<?php
static $regexp =
'/^(?# Assert start of Array Declaration
)(?:(?# Begin Comma Indented Sequence - Last sequence
wont have an ending comma
)ї\s]*("e;|\')ї^\1]*\1ї\s]*(?# Initial Quote Check. SubPattern 1 Used
)(?:=>(?# Arrow Sign. May not exist. If it does, parse a second one
)ї\s]*("e;|\')ї^\2]*\2ї\s]*)(?# End Second Quote Declaration
)(?:,ї\s]*|$)(?# Add a comma or assert the end of the pattern
))*(?# Continue Loop if end of line wasnt asserted
)$/';// Assert end of Regular Expression
echo $regexp;
?>
/^(?# Assert start of Array Declaration
)(?:(?# Begin Comma Indented Sequence - Last sequence
wont have an ending comma
)ї\s]*("e;|')ї^\1]*\1ї\s]*(?# Initial Quote Check. SubPattern 1 Used
)(?:=>(?# Arrow Sign. May not exist. If it does, parse a second one
)ї\s]*("e;|')ї^\2]*\2ї\s]*)(?# End Second Quote Declaration
)(?:,ї\s]*|$)(?# Add a comma or assert the end of the pattern
))*(?# Continue Loop if end of line wasnt asserted
)$/
/^(?# Assert start of Array Declaration
)(?:(?# Begin Comma Indented Sequence - Last sequence
wont have an ending comma
)ї\s]*("e;|')ї^\1]*\1ї\s]*(?# Initial Quote Check. SubPattern 1 Used
)(?:=>(?# Arrow Sign. May not exist. If it does, parse a second one
)ї\s]*("e;|')ї^\2]*\2ї\s]*)(?# End Second Quote Declaration
)(?:,ї\s]*|$)(?# Add a comma or assert the end of the pattern
))*(?# Continue Loop if end of line wasnt asserted
)$/