Re: Regulat expression question
Tech-Archive recommends: Fix windows errors by optimizing your registry
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Wed, 02 May 2007 15:20:56 +0200
mamin@xxxxx wrote:
Hi, I have the following string:
"Data source=(local);Initial catalog=GeomelioDaneEwidencyjne;User
ID=aaa;Password=bbbbb;"
I need to get values of User ID from it. (aaa),
how can I do it using regular expressions?
Adding the special case that the user id may be the last parameter, not
followed by a semicolon (which is not appearent from your example), this
pattern would work:
"(?:^|;)User ID=([^;]+)(?:;|$)"
--
Göran Andersson
_____
http://www.guffa.com
.
Relevant Pages
- Re: Regulat expression question
... how can I do it using regular expressions? ... Adding the special case that the user id may be the last parameter, not followed by a semicolon (which is not appearent from your example), this pattern would work: ... (microsoft.public.dotnet.languages.csharp) - [SUMMARY] Statistician I (#167)
... The heart of this problem, as suggested in the quiz description, is pattern ... have the pattern matching in place, the rest of the code is pretty trivial. ... use regular expressions, or at least review their knowledge. ... Next, as indicated in the comment, square brackets surrounding text are ... (comp.lang.ruby) - Re: position absolute different in IE than firefox, help!
... You referring to the F & R dialog box in BBEdit for Mac? ... Grep is the name of a frequently used Unix command that searches ... does is print out each line of the buffer that matches the pattern. ... The thing they have in common is regular expressions, ... (alt.html) - Re: Verifying email address format
... >>If you were to use Regular Expressions, ... I knew full-well that the Regular Expression pattern I suggested was flawed, ... I think the rules are fairly strictly as to what characters are ... While it's true that email addresses are irregular, ... (microsoft.public.access.formscoding) - Re: what is the quickest way to find out whether a string contains another string?
... Why would anyone want to use regular expressions to look for a plain ... Regular expressions are a tool for deciding whether a String or ... searching is a trivial degeneration of the problem addressed by regular ... input string into a pattern that matches only itself is the first task. ... (comp.lang.java.programmer) |
|