summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2011-11-19 01:27:52 -0600
committerKamil Kaminski <kamilkss@gmail.com>2011-11-19 01:27:52 -0600
commit222e253bd68b96ee3b996dc83bad90b7af46e9e7 (patch)
tree69b534be73e7def029a5714ccfdec7df5830514b
parent7355004fe46fc6bba1da254ef37b64be0d77d532 (diff)
downloadsandbox-222e253bd68b96ee3b996dc83bad90b7af46e9e7.tar.gz
sandbox-222e253bd68b96ee3b996dc83bad90b7af46e9e7.tar.bz2
sandbox-222e253bd68b96ee3b996dc83bad90b7af46e9e7.zip
provide one more regexp in sscanf
-rw-r--r--regexp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/regexp.c b/regexp.c
index ffaa1fc..c1706fb 100644
--- a/regexp.c
+++ b/regexp.c
@@ -2,6 +2,13 @@
int main(int argc, char **argv)
{
+ char *line = " <img src = \"bro.png\" > ";
+ char url[256] = { 0 };
+ //sscanf(line, "<a href=\"%[^\"]\">", url);
+ /* note: i love putting space in sscanf string, it treats them as one or more spaces */
+ if (sscanf(line, " <%*[(a|img)] %*[(href|src)] = \"%[^\"]\">", url))
+ puts(url);
+
char name[50 + 1], email[50 + 1];
char *string = "\"Bro Brotato\" <bro@hax.org>";