Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Regexes are slow (or, why I advocate String::Index)

by revdiablo (Prior)
on May 14, 2004 at 23:46 UTC ( #353529=note: print w/replies, xml ) Need Help??


in reply to Regexes are slow (or, why I advocate String::Index)

strpbrk() (whose name I can't decipher)

In case anyone still wonders, the function name has been demystified:

    <japhy> string pointer break

Which still might not make much more sense (it doesn't to me), but at least we know what it stands for.

Replies are listed 'Best First'.
Re: Re: Regexes are slow (or, why I advocate String::Index)
by Fletch (Chancellor) on May 15, 2004 at 03:18 UTC
    char *strpbrk(const char *s, const char *charset);

    It takes a string (char*) and returns a pointer (char *) to the position to break out the portion of the first string at a position with a character from the charset string.

    OK, not much better. But it is more or less orthagonal to things such as compare no more than n characters from two strings (strncmp()).

        It takes a string (char*) and returns a pointer (char *) to the position to break out the portion of the first string at a position with a character from the charset string.
      I think that this nomenclature goes back to SNOBOL pattern matching, which dates back to 1962.

      There are these two complementary pattern matching operators in SNOBOL:

      SPAN matches a string containing any characters in its argument list, BREAK matches a string containing any characters not in its argument list. I think the implied mnemonic is to SPAN a substring containing a character set or BREAK (stop matching) on a substring containing anything not in the character set.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://353529]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2018-07-18 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (383 votes). Check out past polls.

    Notices?