Results 1 to 6 of 6

Thread: Regular expressions and efficiency

Threaded View

  1. #1
    Administrator
    UK diades's Avatar
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    15,664
    Blog Entries
    6

    Regular expressions and efficiency

    Hi,

    Some time ago I wrote a script in php to read an xml stream, parse the data into the format that I required and present it to the user.

    For the most part, there are no problems but, there is one field of each record that does cause challenges. The data stream comes from a game that is played online called 'VSK5 America's cup challenge' and is a list of all registered players giving their login-names (no problem) and their 'boat-name' - problem!!!

    The boat name is allowed to be 'formatted' by the user both for bold,italic etc., and colour. The formatting uses the syntax shown here: http://vsk.diades.net/formatting.php and, as long as the formatting is used correctly all is ok but, these users are not all 'disciplined' as regards formatting and that is where the mess up occur. If you go here: http://www.diades.net/vsk-rankings.php where the script is in action there is, at the moment, a 'broken' name in the script that is causing a problem on the layout.

    The user
    Code:
    " K3y 77 - Poppy " "
    is obviously using unmatched quote makes (no rules for that) , here is the actual 'script for the login name shown:
    Code:
    $s $f00 " K3y 77 - Poppy " "
    Another as shown on the page:
    Code:
    ita_
    
    pa
    
    o
    LO $m$i$0f0 (v$fffsk$f03a$f00)
    As you see, most of the formatting in this instance is being ignored (perhaps because there are newline chars in there?. Again the actual unparsed login:
    Code:
    $0f0ITA_$fffPA$f00OLO $m$i$0f0 (v$fffsk$f03a$f00)
    $0f0ITA_$fffPA$f00OLO $m$i$0f0 (v$fffsk$f03a$f00)

    The red above showing the formatting codes.

    I have attached the file, the whole script requires upgrading from php4 to php5 which is on my todo list but it is the parsing of the formatting that is bugging me if anyone can help overcome the nasties.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Other: Regular Expressions
    By George W. Bush in forum Server-side Forum
    Replies: 1
    Last Post: 11th August 2005, 11:20
  2. Regular Expressions
    By Operandi in forum Server-side Forum
    Replies: 2
    Last Post: 18th July 2005, 05:21
  3. regular expressions
    By kiran in forum Client-side forum
    Replies: 1
    Last Post: 19th April 2002, 20:36
  4. Regular Expressions
    By GSHelpBoy in forum Server-side Forum
    Replies: 2
    Last Post: 18th April 2002, 14:49
  5. JSP Regular Expressions
    By bdale in forum Server-side Forum
    Replies: 0
    Last Post: 19th November 2001, 13:53

Bookmarks

Posting Permissions

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