Skip to content

Commit 295a076

Browse files
committed
regex docs
1 parent 9cdd301 commit 295a076

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Text/Parsing/Parser/String.purs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,24 @@ unCodePoint = unsafeCoerce
247247
-- | }
248248
-- | ```
249249
-- |
250-
-- | If you want to use the defaults then pass
250+
-- | To use the defaults, pass
251251
-- | `{}` as the flags argument. For case-insensitive pattern matching, pass
252252
-- | `{ignoreCase: true}` as the flags argument.
253+
-- |
253254
-- | The other `Data.String.Regex.Flags.RegexFlagsRec` fields are mostly
254255
-- | nonsense in the context of parsing
255256
-- | and use of the other flags may cause strange behavior in the parser.
256257
-- |
257258
-- | [*MDN Advanced searching with flags*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#advanced_searching_with_flags)
259+
-- |
260+
-- | #### Example
261+
-- |
262+
-- | ```
263+
-- | runParser "ababXX" (regex {} "(ab)+")
264+
-- | ```
265+
-- | ```
266+
-- | (Right "abab")
267+
-- | ```
258268
regex
259269
:: forall m flags f_
260270
. Monad m

0 commit comments

Comments
 (0)