![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 news C69E282-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 Specs![]() |
| | #3 (permalink) |
| 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 > news C69E282-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 Specs![]() |
![]() |
| 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 |