D Documentation  
find
int find(rchar[] string, char[] pattern, char[] attributes = null)

Search string for the first match with pattern with attributes. Returns the index in string of the match if found, -1 if no match.

Example:
import std.stdio;
import std.regexp;

int main() {
  // find the index of the first word that contains the letter n
  char[] str = "Regular expressions can be fun!";
  int index = find(str,"[a-z]*n[a-z]*","i"); // ignore case
  writefln("Index: %d",index);

  // determine if the string contains an integer
  index = find(str,"-?[0-9]+");
  if(index == -1) {
    writefln("No integers found.");
  }
  return 0;
}

Output:
Index: 8
No integers found.
Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.