string parsing

Results 1 to 2 of 2

Thread: string parsing

  1. #1
    Join Date
    Dec 1969

    Default string parsing

    I want to parse the text(given below) and save the time(hours and minutes) into a database. How can I do it. The text below is coming from database aswell. Thanks in advance<BR><BR><BR>The user LINDTdlussier connected on port COM1 on 11/13/2000 at 03:15pm and disconnected on 11/13/2000 at 03:47pm. The user was active for 32 minutes 32 seconds. 68944 bytes were sent and 20632 bytes were received. The port speed was 28800.

  2. #2
    Join Date
    Dec 1969

    Default RE: string parsing

    I&#039d say you&#039re looking at using a complex regular expression, or a few smaller regular expressions (which would be easier)<BR><BR>there&#039s a reference to JScript regExp in the JScript language reference (available to the left of this page) - or the O&#039Reilly Rhino Book (JavaScript-definitive guide) has a good section on regExp, if you have access to a copy.<BR><BR>something like /on(.{20})/gi<BR><BR>then grab regExp.$1 and regExp.$2 which should contain the dat and time (with &#039at&#039 still in place). you can split(&#039at&#039) or use RegExp again to replace it out...<BR><BR>not tested, not guaranteed<BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts