Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Escape the $ sign

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-06-2007   #1 (permalink)
Jay
Guest


 

Escape the $ sign

Hi All,
Can't seem to get the correct regex to escape out the $ sign for ...
http://www.publicdebt.treas.gov/opd/opdpenny.htm
Current Amount
02/05/2007 $8,696,353,575,213.24
I'm trying to pull down the national debt figure.
Tried things like the following but not working yet.
PS H:\> [regex] $debt = '$8,696,353,575,213.24'
PS H:\> $debt.tostring()
$8,696,353,575,213.24
PS H:\> $debt.match("`$\d,\d{3,3}")
PS H:\> $debt.match("\`$\d,\d{3,3}")
PS H:\> $debt.match("\$\d,\d{3,3}")
Thanks for any help.
Jay

My System SpecsSystem Spec
Old 02-07-2007   #2 (permalink)
/\\/\\o\\/\\/ [MVP]
Guest


 

Re: Escape the $ sign

the regex need to be in the constuctor

PoSH> [regex] $debt = '\$\d,\d{3,3}'
PoSH> $debt.Match('$8,696,353,575,213.24')


Groups : {$8,696}
Success : True
Captures : {$8,696}
Index : 0
Length : 6
Value : $8,696

Greetings /\/\o\/\/
"Jay" <Jay@discussions.microsoft.com> wrote in message
newsC69E282-5BAC-4596-AEA1-C7AA5D42563F@microsoft.com...
> Hi All,
> Can't seem to get the correct regex to escape out the $ sign for ...
> http://www.publicdebt.treas.gov/opd/opdpenny.htm
> Current Amount
> 02/05/2007 $8,696,353,575,213.24
> I'm trying to pull down the national debt figure.
> Tried things like the following but not working yet.
> PS H:\> [regex] $debt = '$8,696,353,575,213.24'
> PS H:\> $debt.tostring()
> $8,696,353,575,213.24
> PS H:\> $debt.match("`$\d,\d{3,3}")
> PS H:\> $debt.match("\`$\d,\d{3,3}")
> PS H:\> $debt.match("\$\d,\d{3,3}")
> Thanks for any help.
> Jay


My System SpecsSystem Spec
Old 02-07-2007   #3 (permalink)
Jay
Guest


 

Re: Escape the $ sign

Perfect. Works great.
Just had it all upside down I guess.
Thanks for the help.
Jay

"/\/\o\/\/ [MVP]" wrote:

> the regex need to be in the constuctor
>
> PoSH> [regex] $debt = '\$\d,\d{3,3}'
> PoSH> $debt.Match('$8,696,353,575,213.24')
>
>
> Groups : {$8,696}
> Success : True
> Captures : {$8,696}
> Index : 0
> Length : 6
> Value : $8,696
>
> Greetings /\/\o\/\/
> "Jay" <Jay@discussions.microsoft.com> wrote in message
> newsC69E282-5BAC-4596-AEA1-C7AA5D42563F@microsoft.com...
> > Hi All,
> > Can't seem to get the correct regex to escape out the $ sign for ...
> > http://www.publicdebt.treas.gov/opd/opdpenny.htm
> > Current Amount
> > 02/05/2007 $8,696,353,575,213.24
> > I'm trying to pull down the national debt figure.
> > Tried things like the following but not working yet.
> > PS H:\> [regex] $debt = '$8,696,353,575,213.24'
> > PS H:\> $debt.tostring()
> > $8,696,353,575,213.24
> > PS H:\> $debt.match("`$\d,\d{3,3}")
> > PS H:\> $debt.match("\`$\d,\d{3,3}")
> > PS H:\> $debt.match("\$\d,\d{3,3}")
> > Thanks for any help.
> > Jay

>

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
escape key stopped working Alex Vista General 2 08-18-2008 04:11 PM
WebClient, don't want Escape PSApple PowerShell 3 02-18-2008 02:38 PM
Escape character question lawndart PowerShell 2 08-07-2007 01:43 PM
No escape from Norton! varuna21 Vista security 4 04-10-2007 11:46 PM
how to escape @ ktmd PowerShell 7 11-12-2006 06:42 AM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008