Re: regex syntax



thank you again. you are wonderfully helpful.

I did find the pattern string getting too huge. So I started to split date
pattern into 3 components before using them to compose the final pattern,
although I did not use the string format method.


"Oliver Sturm" <oliver@xxxxxxxxxxxx> wrote in message
news:eQV5%23lJpFHA.620@xxxxxxxxxxxxxxxxxxxxxxx
> jg wrote:
>
>> Great, it works even after taking out the $ and the space around the |..
>> I did add \b before the entire expression to make sure the first part of
>> the date is on the word boundary. This way I can avoid some supposedly
>> low probability errors like some strange catalogue dot or dash notations
>
> Sure, I didn't know your exact circumstances, so you'd have to make
> modifications to my sample to make it work for you completely.
>
>> Now all I have to do is to make it work with January, February,... (
>> fully spelled month names). I guess I can always add another 12 | parts
>> to the month expressions
>
> Sure you can. If you find the whole thing growing too much, maybe you
> could define the various parts you need (the month expression, the day
> expression, the two digit year, the four digit year) as string constants
> in your code and use a String.Format to put them together to form the
> complete regular expression before you use it. That way it might be a bit
> more maintainable - otherwise you'll have to make every change to one of
> the parts in many places, increasing the probability of an error.
>
>
>
> Oliver Sturm
> --
> omnibus ex nihilo ducendis sufficit unum
> Spaces inserted to prevent google email destruction:
> MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
> ICQ 27142619 http://www.sturmnet.org/blog


.



Relevant Pages

  • Re: SimpleDateFormat Problem while Parsing Date/time String on Japanese OS
    ... For formatting, if the number of pattern letters is 2, the year ... Any other numeric string, such as a one digit string, a three ...
    (comp.lang.java.programmer)
  • Re: Predicting the Future and Kolmogorov Complexity
    ... Predictability is based on the pattern itself. ... addition to the string. ... For any prediction scheme, there are computable strings that show no ... Out of this hole comes a ~2 cm blue marble followed by a red ...
    (talk.origins)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: Entropy in crystalization: up or down?
    ... such a pattern as "artifact" has exactly the same fundamental basis ... for accepting a certain type of narrow band radiosignal as artifact. ... and *that* is the reason that induction on a data string alone is worthless. ... over and over again, in radiosignals. ...
    (talk.origins)