Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    problema regular expression

    Ciao a tutti

    Questa regex

    reg = /^([^ ]+) +([^ ]+) +[^ ]+ +([^ ]+) +([[][^]]+[]]) +"([^"]*)" +([^ ]+) +([^ ]+) +("[^"]*") +("[^"]*") +("[^"]*") +"([^"]*)" +"([^"]*)" +"([^"]*)" +"([^"]*)" +"(.+)" +"([^"]*)" +"([^"]*)" +"([^"]*)" +"([^"]*)" +(.+)$/

    continua a generarmi questo errore

    c:\ruby\bin\ruby.exe: warning: character class has ']' without escape
    c:\ruby\bin\ruby.exe: warning: character class has ']' without escape
    c:\ruby\bin\ruby.exe: warning: character class has ']' without escape
    00reverse_fastest_nocustom.rb:6: premature end of char-class: /^([^ ]+) +([^ ]+) +[^ ]+ +([^ ]+) +([[][^]]+[]]) +"([^"]*
    )" +([^ ]+) +([^ ]+) +("[^"]*") +("[^"]*") +("[^"]*") +"([^"]*)" +"([^"]*)" +"([^"]*)" +"([^"]*)" +"(.+)" +"([^"]*)" +"(
    [^"]*)" +"([^"]*)" +"([^"]*)" +(.+)$/


    Qualcuno ha qualche idea da suggerirmi?

    Grazie mille
    Realizzazione siti web
    ____________________________
    how terrible thing is knowledge when it brings no profit to the wise...

  2. #2
    Utente di HTML.it L'avatar di toraz
    Registrato dal
    Nov 2001
    Messaggi
    263
    Francamente, così a prima vista, l'unica cosa che mi pare un po' sospetta è questa
    codice:
    ([[][^]]+[]])
    A parte questo l'errore sta proprio nell'espressione in se, un arnese del genere sta li pronto a esploderti in mano... non è che ci sia una soluzione migliore al tuo problema?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.