Q:

.NET regex with quote and space

I'm trying to create a regex to match this:
/tags/ud617/?sort=active&amp;page=2" >2

So basically, "[number]" is the only dynamic part:
/tags/ud617/?sort=active&amp;page=[number]" >[number]

The closest I've been able to get (in PowerShell) is:
[regex]::matches('/tags/ud617/?sort=active&amp;page=2" >2
','/tags/ud617/\?sort=active&amp;page=[0-9]+')

But this doesn't provide me with a full match of the dynamic string.
Ultimately, I'll be creating a capture group:
/tags/ud617/?sort=active&amp;page=([number])

A:

Seems easy enough:
 $regex = '/tags/ud617/\?sort=active&amp;page=(\d+)"\s>2'

'/tags/ud617/?sort=active&amp;page=2" >2' -match $regex > $nul

$matches[1]

2

