[sf]?scanf regexp?

Member
Posts: 567
Joined: 2004.07
Post: #1
how complete IS the regexp? I'm writing an obj loader, and I want to do a...

sscanf("f %d/%d?/%d?" etc, and I'm not sure if the scanf family supports it. Anyone have any clue?

It's not magic, it's Ruby.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
see the man page for scanf using Terminal.app

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #3
thanks, but that doesn't help in the way I was looking for; scanf clearly has some support for regexp-esq functions, though (just as clearly) it doesn't support it per se.

Though, for a bit of a laugh, read this: http://www.gidnetwork.com/b-62.html and this: http://www.gidnetwork.com/b-60.html. Hasn't he heard of GIGO?

It's not magic, it's Ruby.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Scanf has nothing to do with regexps, and doesn't support optional conversions AFAIK, though as ed says, read the man page.
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #5
As I said before; it supports regexp-esq features.

It's not magic, it's Ruby.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #6
"In computing, a regular expression is a string that is used to describe or match a set of strings, according to certain syntax rules."

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #7
Ahh yes, that is a regular expression, but that is NOT regular expression.

It's not magic, it's Ruby.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #8
It doesn't support any regexp-esque features. It does straight-line pattern matching, without allowing alternation or repetition. It's nothing like a regexp, and nowhere near as powerful.
Quote this message in a reply
Post Reply