NameSilo

RegularExpression Question

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Unknown

Established Member
Impact
3
Is there a character that will end the match once the criteria of the pattern is met and start a new match?

I'm having an issue where if I put two identical matching strings next to each other, they get matched as one.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
It sounds like you want a non-greedy match. Regexps are usually greedy by default. This means they will try to match as much as possible. A non-greedy regular expression will match as little as possible.

Put a question mark ("?") after the end of the expression to make it non-greedy.

Examples:

string "abxcdx", regexp ".*x" matches "abxcdx".
string "abxcdx", regexp ".*?x" matches "abx" and "cdx".
 
0
•••
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Parking: find your domains by pasting a list
You can now paste a list of domain names into the search box at the top of the Parking menu. Put one name on each line. Your domain list...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back