0
Birden çok kaynaktan dosya koleksiyonum var. Ben önceden tüm olası desenleri kod biliyorum, ama yerine otomatik başaracağımDizeleri okumak ve bir Regexp döndürmek mümkün mü?
File 1: A) B) C) D) E)
File 2: a) b) c) d) e)
File 3: a. b. c. d. e.
File 4: a- b- c- d- e-
(...)
:
Her dosya gibi dizeleri içeriyor.
Bir programın dosyayı okuması ve şekil desen yapması mümkün mü? Ör:
File 1: A) B) C) D) E) # => [ABCDE]\)
File 2: a) b) c) d) e) # => [abcde]\)
File 3: a. b. c. d. e. # => [abcde]\.
File 4: a- b- c- d- e- # => [abcde]-
Ne yapmak istediğinize bağlıdır [burada] (http://www.regexformat.com/version_files/Rx5_ScrnSht01.jpg) ve [burada] (http://www.regexformat.com/Dnl/_Samples/_Ternary_Tool % 20 (sözlük)/___ txt /). Üçlü ağaçtan bir normal ifade oluşturur. – sln
Olası kopya: http://stackoverflow.com/questions/616292/is-it-possible-for-a-computer-to-learn-a-regular-expression-by-user-provided-e – Amadan
http:/okuyun /stackoverflow.com/a/5395777/128421. Buna dayanarak bir şeyler inşa edebilmelisiniz. –