Comments (3)
the third example is still valid as it still contains 10 digits.
$regExp = (new RegExpBuilder)
->startOfInput() //expect start of input before digits
->exactly(10)->digits()
->endOfInput() //expect end of input after digits
->getRegExp();
should do the trick
from regexpbuilderphp.
updated, missed the startOfInput()
call. Otherwise you would still have 10digits, then endOfInput...
from regexpbuilderphp.
Works like a charm! Thank you.
Btw, great idea for a library. So much helpful!
from regexpbuilderphp.
Related Issues (17)
- anyOf Method HOT 5
- How to get everything between tags HOT 1
- Class 'Gherkins\RegExpBuilderPHP\RegExpBuilder' not found HOT 3
- There is no way to set the "s" flag HOT 3
- group name HOT 2
- Groups & globalMatch() don't mix well HOT 2
- VerbalExpressions diff HOT 1
- Composer issue HOT 3
- Missing maintainer HOT 6
- Coverage should be run only against one PHP version. HOT 1
- Question, can I use back references HOT 2
- rename "test" method name to something like "matches", or "doesMatch" HOT 4
- escape delimiter when sanitizing strings
- Exact digits matching HOT 1
- Start of group? HOT 2
- Match any 0+ of lineBreaks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from regexpbuilderphp.