Other Resources:

n or more times repetition quantifier {n,}

Q

What is the "n or more times" repetition quantifier? How to use it?

How to write a regular expression using a repetition quantifier to capture the value of PI like: 3.1415926535897932384626433832795028841971 with a precision of at least 5 decimal digits?

✍: FYIcenter.com

A

The "n or more times" repetition quantifier allows us to repeat a pattern unit at least n or more times. The "n or more times" repetition quantifier '{n,}' and it needs be placed immediately after the pattern unit. For example:

\d{10,} # matches '6973738433' from 'World population: 6973738433'

The regular expression to capture the value of PI with a precision of at least 5 decimal digits::

```
3\.\d{5,}
3\. - matches '3.'
\d{5,} - repeats \d at least 5 times
```

2013-01-26, 2198👍, 0💬

Popular Posts:

Are you having problems using regular expressions when processing text strings in your applications ...

All credit card numbers issued by JCB have 3 sets of numbers: JCB cards start with 2131 have 15 digi...

A free online regular expression test tool that allows to try you regular expression pattern and see...

How to capture the Baidu spider entries from Web log file? Here are some Web log file entries:127.0....

How to write a regular expression to validate GUID (Globally Unique IDentifier) or UUID (Universally...