Regex syntax assistance please.

Chitchat about x² / 2X products

Moderators: fgagnon, nikos, Site Mods

Post Reply
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Regex syntax assistance please.

Post by dunno »

I need to find and replace all text within a document named "page 1, page 2, page 3, .....page 101 etc..."

What would be the syntax for that ?.

Any assistance would be welcome.

EDIT:
I plagiarised this from the wuh wuh wuh,
([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])
and appended Page to it, seems to work.

and then I found this
Page [0-9]+

Thank you.

*returns to hammock*
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Regex syntax assistance please.

Post by Kilmatead »

dunno wrote:...and then I found this "Page [0-9]+"
You could also use "Page \d" (\d matches any numerical digit, same as the group [0-9]. People like the group-syntax better because it's a little clearer (generally speaking) and can be tailored more specific then just "any" numerical digit easily. If you wanted a range of page-numbers, that's possible too, but a little more complex to define (and life's too short) - this stuff can get highly amusing. :wink:
Post Reply