diff --git a/Highlight.hs b/Highlight.hs
--- a/Highlight.hs
+++ b/Highlight.hs
@@ -94,7 +94,7 @@
      then hPutStrLn stderr ("Unknown syntax: " ++ lang) >> exitWith (ExitFailure 4)
      else return ()
   let highlightOpts = (if TitleAttributes `elem` opts then [OptTitleAttributes] else []) ++
-                      (if NumberLines `elem` opts then [OptNumberLines] else [])
+                      (if NumberLines `elem` opts then [OptNumberLines, OptLineAnchors] else [])
   let css = case cssPathOf opts of
                    Nothing      -> style ! [thetype "text/css"] $ primHtml defaultHighlightingCss 
                    Just cssPath -> thelink ! [thetype "text/css", href cssPath, rel "stylesheet"] << noHtml
diff --git a/Text/Highlighting/Kate/Common.hs b/Text/Highlighting/Kate/Common.hs
--- a/Text/Highlighting/Kate/Common.hs
+++ b/Text/Highlighting/Kate/Common.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {- |
    Module      : Text.Highlighting.Kate.Common
    Copyright   : Copyright (C) 2008 John MacFarlane
@@ -11,7 +12,12 @@
 -}
 
 module Text.Highlighting.Kate.Common where
+#ifdef _PCRE_LIGHT
 import Text.Regex.PCRE.Light.Char8
+#else
+import System.IO.Unsafe (unsafePerformIO)
+import Text.Regex.PCRE.String
+#endif
 import Text.Highlighting.Kate.Definitions
 import Text.ParserCombinators.Parsec
 import Data.Char (toUpper, isDigit, chr)
@@ -163,6 +169,26 @@
 subDynamic (x:xs) = subDynamic xs >>= return . (x:)
 subDynamic "" = return ""
 
+compileRegex :: String -> Regex
+#ifdef _PCRE_LIGHT
+compileRegex regexpStr = compile ('.' : escapeRegex regexpStr) [anchored]
+#else
+compileRegex regexpStr =
+  case unsafePerformIO $ compile (compAnchored) (execNotEmpty) ('.' : escapeRegex regexpStr) of
+        Left _ -> error $ "Error compiling regex: " ++ regexpStr
+        Right r -> r
+#endif
+
+matchRegex :: Regex -> String -> Maybe [String]
+#ifdef _PCRE_LIGHT
+matchRegex r s = match r s [exec_notempty] 
+#else
+matchRegex r s = case unsafePerformIO (regexec r s) of 
+                      Right (Just (_, mat, _ , capts)) -> Just (mat : capts)
+                      Right Nothing -> Nothing
+                      Left matchError -> error $ show matchError
+#endif
+
 pRegExpr :: Regex -> GenParser Char SyntaxState String
 pRegExpr compiledRegex = do
   st <- getState
@@ -172,12 +198,12 @@
   let remaining = if charsParsedInLine == 0
                      then ' ':curLine
                      else drop (charsParsedInLine - 1) curLine 
-  case match compiledRegex remaining [exec_notempty] of
+  case matchRegex compiledRegex remaining of
         Just (x:xs) -> do if null xs
                              then return ()
                              else updateState (\st -> st {synStCaptures = xs})
                           string (drop 1 x) 
-        _           -> fail $ "Regex " ++ (show compiledRegex) ++ " failed to match"
+        _           -> pzero
 
 pRegExprDynamic :: [Char] -> GenParser Char SyntaxState String
 pRegExprDynamic regexpStr = do
@@ -193,19 +219,11 @@
   chr (read ['0','o',x,y,z]) : escapeRegex rest
 escapeRegex (x:xs) = x : escapeRegex xs 
 
-compileRegex :: String -> Regex
-compileRegex regexpStr = compile ('.' : escapeRegex regexpStr) [anchored]
-
 integerRegex :: Regex
 integerRegex = compileRegex "\\b[-+]?(0[Xx][0-9A-Fa-f]+|0[Oo][0-7]+|[0-9]+)\\b"
 
 pInt :: GenParser Char SyntaxState String
 pInt = pRegExpr integerRegex 
-
-pUnimplemented :: GenParser Char st [Char]
-pUnimplemented = do
-  fail "Not implemented"
-  return ""
 
 floatRegex :: Regex
 floatRegex = compileRegex "\\b[-+]?(([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)\\b"
diff --git a/Text/Highlighting/Kate/Format.hs b/Text/Highlighting/Kate/Format.hs
--- a/Text/Highlighting/Kate/Format.hs
+++ b/Text/Highlighting/Kate/Format.hs
@@ -13,10 +13,12 @@
 module Text.Highlighting.Kate.Format ( formatAsXHtml, FormatOption (..), defaultHighlightingCss ) where
 import Text.Highlighting.Kate.Definitions
 import Text.XHtml.Transitional
+import Data.List (intersperse)
 
 -- | Options for formatters.
 data FormatOption = OptNumberLines     -- ^ Number lines
                   | OptNumberFrom Int  -- ^ Number of first line
+                  | OptLineAnchors     -- ^ Anchors on each line number 
                   | OptTitleAttributes -- ^ Include title attributes
                   deriving (Eq, Show, Read)
 
@@ -33,7 +35,10 @@
          then let lnTitle = title "Click to toggle line numbers"
                   lnOnClick = strAttr "onclick" "with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"
                   lineNumbers = td ! [theclass "lineNumbers", lnTitle, lnOnClick] $ pre <<
-                                     (unlines $ map show [startNum..(startNum + numberOfLines - 1)])
+                                     (intersperse br $ map lineNum [startNum..(startNum + numberOfLines - 1)])
+                  lineNum n = if OptLineAnchors `elem` opts
+                                 then anchor ! [identifier $ show n] << show n
+                                 else stringToHtml $ show n
                   sourceCode = td ! [theclass "sourceCode"] $ 
                                     pre ! [theclass $ unwords ["sourceCode", lang]] $ code
               in  table ! [theclass "sourceCode"] $ tr << [lineNumbers, sourceCode]
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,3 +1,15 @@
+highlighting-kate 0.2.6 (22 Jan 2010)
+
+  * Added OptLineAnchors FormatOption.  When used with
+    OptNumberLines, this includes a link anchor on each line,
+    so users can link to a particular line in a highlighted source
+    file.  Thanks to Daniel Patterson for the idea.
+
+  * Default to using regex-pcre-builtin, unless pcre-light flag is
+    turned on.  regex-pcre-builtin contains c sources for pcre, so it
+    should now be possible to install highlighting-kate without manually
+    installing the pcre library first -- a hurdle for some users.
+
 highlighting-kate 0.2.5.1 (29 Nov 2009)
 
   * Modified ParseSyntaxFiles to use UTF8, since otherwise hscolour
diff --git a/highlighting-kate.cabal b/highlighting-kate.cabal
--- a/highlighting-kate.cabal
+++ b/highlighting-kate.cabal
@@ -1,5 +1,5 @@
 Name:                highlighting-kate
-Version:             0.2.5.1
+Version:             0.2.6
 Cabal-Version:       >= 1.2
 Build-Type:          Simple
 Category:            Text
@@ -94,13 +94,21 @@
 Flag executable
   Description:       Build the Highlight executable.
   Default:           False
+Flag pcre-light
+  Description:       Use the pcre-light library instead of regex-pcre-builtin
+  Default:           False
 
 Library
   if flag(splitBase)
     Build-Depends:   base >= 3 && < 5, containers
   else
     Build-Depends:   base < 3
-  Build-Depends:     parsec < 3, pcre-light, xhtml
+  if flag(pcre-light)
+    Build-depends:   pcre-light
+    cpp-options:     -D_PCRE_LIGHT
+  else
+    Build-depends:   regex-pcre-builtin
+  Build-Depends:     parsec < 3, xhtml
   Exposed-Modules:   Text.Highlighting.Kate
                      Text.Highlighting.Kate.Syntax
                      Text.Highlighting.Kate.Definitions
@@ -172,6 +180,8 @@
 Executable Highlight
   Main-Is:          Highlight.hs
   Build-Depends:    base, containers, xhtml, filepath
+  if flag(pcre-light)
+    cpp-options:     -D_PCRE_LIGHT
   Ghc-Options:      -W
   Ghc-Prof-Options: -auto-all
   -- the following line is needed to prevent gcc from consuming huge amounts of
