regex - Meaning of \b in .Net Regular Expressions

26
2014-06
  • abelenky

    Microsoft has a nifty quick reference card for .Net Regular Expressions.

    But it seems to list \b as both matching Backspace and also matching "On word boundary".

    Which is it? Can \b really do both? How can you be precise about which one you mean?

  • Answers
  • Olivier Jacot-Descombes

    \b means "word boundary" outside of character classes (also called character sets) and "backspace" inside character classes.

    Here it means a word boundary:

    \bhello\b
    

    Here it means a backspace

    [\b]
    

    See this Microsoft reference: Character Escapes in Regular Expressions.
    PERL regex has the same definition for \b.


  • Related Question

    performance - Warm-up .NET application
  • boj

    We have speed problems in corporate enviroment.

    Most of the notebooks are strongly loaded: the start-up time of Excel is 3-5 minutes, Outlook 10-15 minutes etc.

    Our application has the same start-up time, instead of the normal 10-20 seconds. If once it started, after a program restart it works fine.

    How is it possible to warm-up our application?

    My first tought was to write a small script and run it right before our application startup:

    • connect to the local SQL Server and get some data
    • preload assemblies
    • ???

    But I think it's not enough - or totally a mistake.

    Edit:

    They have IBM Thinkpad X40 notebooks with 1GB RAM. Specialized Windows XP installed (I think this + background installers are the root of all our problems).


  • Related Answers
  • gridzbi

    If the machines are this grossly under-powered then I'd make the argument to your superiors that the problems lie in the companies IT provision to staff. I'd say any development time spent on this would be ill-spent.

  • sventevit

    Maybe a bit naive, but still... format & reinstal Windows :-)

  • Rick

    What do you mean strongly loaded?

    From your symptoms the problem might be that they do not have enough RAM. In which case when you start your applications they will have to swap previously running applications into virtual memory.

    When you close that application and restart it straight away, you will have free RAM so it will restart quickly.

    But it will do no good if you do something else in the meantime, i.e. open Outlook, close Outlook, open Excel - do some work, then if you open Outlook again it will not open quickly, i.e. your original suggestion to try and automatically open and close your application (at bootup?) won't help.

  • David Basarab

    Perhaps this is a roaming profile issue? I don't know about your program, but Excel and Outlook make significant use of the User folder, which is probably stored somewhere on your corporate network for each Active Directory account. My guess is that either the network or the storage system is too slow for your 300+ users.

  • Florian Doyon

    You should also consider distributed optimized native assemblies that will take some work off the JIT at startup/early app lifecycle time.

    Have a look at NGEN, it's basically doing JIT at compile time, and some other preloading magic!

    http://msdn.microsoft.com/en-us/library/6t9t5wcf%28VS.80%29.aspx

    Cheers, Florian

  • Psycogeek

    What are the metrics you see via Task Manager ?

    Which Process is consuming the most CPU ?

    Which Processes are consuming RAM ?

    Is there an anti virus running in the background doing a full scan every time a computer starts ?

    how many Page Faults by which processes ?

    Whats the Configuration of Computers and which Softwares ?

  • Klay

    As Simon hinted at above, this shouldn't be the type of issue you try to work around using a warmup script. I'd suggest serious hardware and software upgrades. I mean 15 minutes to start outlook?