Created
October 28, 2015 11:14
-
-
Save richlv/ff40e6460a696b1ca667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- possible input : | |
key [t|a] | |
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ | |
key2[param] [u|1] | |
something else | |
key3[[param,param],param] [z|44] | |
--- desired output (validating trimmed $1 for something like [a-zA-Z0-9\[*] ): | |
key | |
key2[ | |
key3[ | |
--- reasoning : | |
key [t|a] <- [ present, no [ in $1, whole $1 taken | |
<style <![CDATA[/*><!--*/ <- $1 does not match | |
key2[param] [u|1] <- [ present on line and in $1, $1[ taken | |
something else <- no [ on the whole line | |
key3[[param,param],param] [z|44] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment