String.Format and Curley Braces

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello all,

I am trying my hand at RegEx and came across a tangent; curley braces upset
string.format expressions. Is there a way to escape them with out making
them an argument?

strTemp = string.format("This is my string }{") =Exception thrown
strTemp = string.format("This is my string {0}{1}","}"."{") = This is my
test string }{

my reason for useage:

Allow any alphanemeric value x to x+n times where x and x+n are passed in
values

string.format("\b[a-zA-Z0-9]{{0},{1}}\b", MinLen, MaxLen)

becomes

string.format("\b[a-zA-Z0-9]{0}{1},{2}{3}}\b","{", MinLen, MaxLen, "}")

Thanks


.



Relevant Pages

  • Re: What is the Fastest spinning man made Object?
    ... >building a huge ring one could get the velocity relativistic. ... >> the escape velocity, required to escape from the binding potential. ... >> Now, adding gravity to the mix, the velocity becomes the escape ... simplicity) tangent to it. ...
    (sci.physics)
  • Re: RegEx - Chk for special chars
    ... the dot in regular expressions has a special meaning. ... Generally it never hurts to escape, so when something could go either way, ...
    (comp.lang.php)
  • Re: RegEx - Chk for special chars
    ... the dot in regular expressions has a special meaning. ... Generally it never hurts to escape, so when something could go either way, ...
    (comp.lang.php)
  • Re: Regular expression to allow only selected string values
    ... I get confused with when to escape and when not to ... it's easier to use single quotes if ... sed uses basic regular expressions. ... You also get some extras like "+" with extended regular ...
    (comp.unix.shell)
  • Re: String.Format and Curley Braces
    ... > string.format expressions. ... Is there a way to escape them with out making ... > test string}{ ... Jon Skeet - ...
    (microsoft.public.dotnet.general)