Che Posted August 3, 2015 Report Posted August 3, 2015 (edited) La aceasta pagina de aici:https://ro.wikipedia.org/wiki/List%C4%83_de_nume_rom%C3%A2ne%C8%99ti_-_litera_SAs vrea, care se pricepe, sa-mi scrie o expresie regex care sa-mi selecteze doar acele nume care au TOATE aceste caracteristici:1. Incep cu S si se termina in n sau c.2. Contin obligatoriu litera n, litera a si litera l (adica L, nu i).3. Nu au mai mult de 10 litere.4. Nu contine g, j, x, k, z, y, w, q.Multumesc anticipat ! Edited August 3, 2015 by Che Quote
Che Posted August 4, 2015 Author Report Posted August 4, 2015 Input:SaSaba (wikt)Sabadac (wikt)Sabada? (wikt)Sabadî? (wikt)Sabado? (wikt)Sab?u (wikt)Sabcu (wikt)Sabie (wikt)Sabin (wikt)Sabinevschi (wikt)Sabloschi (wikt)Sabo (wikt)Sabou (wikt)Sabu (wikt)Sabuc (wikt)Sacaci (wikt)Sacaliu (wikt)Sacaliuc (wikt)Sacalo? (wikt)Sacazof (wikt)Sacerdo?eanu (wikt)Sachelari (wikt)Sachelarie (wikt)Sachin (wikt)Sacot? (wikt)Saculea (wikt)Sadagurschi (wikt)Sadica (wikt)Sadici (wikt)Sadiu (wikt)Sadovac (wikt)Sadovan (wikt)Sadoveac (wikt)Sadoveanu (wikt)Sadovei (wikt)Sadovinschi (wikt)Saegiu (wikt)Safalichi (wikt)Safca (wikt)Safcencu (wikt)Safer (wikt)Safir (wikt)Safirescu (wikt)Safriuc (wikt)Safta (wikt)Ce am reusit sa fac:S\w+[^gjxkzywq(wikt)]daca ii adaug n\b imi da doar Sadovan si mai sunt si altelke terminate in n in lista, un alt exemplu fiind Sabin.Cum fac sa fie terminat ori in n, ori in c ?Plus,2. Contin obligatoriu litera n, litera a si litera l (adica L, nu i).3. Nu au mai mult de 10 litere. (intre 5 si 10 litere). Quote
H3xoR Posted August 4, 2015 Report Posted August 4, 2015 (edited) La aceasta pagina de aici:https://ro.wikipedia.org/wiki/List%C4%83_de_nume_rom%C3%A2ne%C8%99ti_-_litera_SAs vrea, care se pricepe, sa-mi scrie o expresie regex care sa-mi selecteze doar acele nume care au TOATE aceste caracteristici:1. Incep cu S si se termina in n sau c.2. Contin obligatoriu litera n, litera a si litera l (adica L, nu i).3. Nu au mai mult de 10 litere.4. Nu contine g, j, x, k, z, y, w, q.Multumesc anticipat !Încearc? expresia asta:\bS(?=.*a)(?=.*n)(?=.*l)[^gjxkzywq]{0,8}[nc]\bPS:Nume g?site:Salamon (wikt)Salatan (wikt)Salenciuc (wikt)Salmen (wikt)Sarafolean (wikt)....... Edited August 4, 2015 by H3xoR Quote
Che Posted August 4, 2015 Author Report Posted August 4, 2015 Încearc? expresia asta:\bS(?=.*a)(?=.*n)(?=.*l)[^gjxkzywq]{0,8}[nc]\bPS:Nume g?site:Salamon (wikt)Salatan (wikt)Salenciuc (wikt)Salmen (wikt)Sarafolean (wikt).......Vad ca nu merge expresia. Unde ai testat-o ? Pe ce limbaj ? Javascript, pcre, php ? Am incercat si online si tot nu merge. Quote
H3xoR Posted August 4, 2015 Report Posted August 4, 2015 (edited) Vad ca nu merge expresia. Unde ai testat-o ? Pe ce limbaj ? Javascript, pcre, php ? Am incercat si online si tot nu merge.De testat, am testat-o aici: https://regex101.com/r/eC5iD0/1Ce limbaj? Toate limbajele care au implementat o versiune de Regex folosind ECMAScript syntax (JS/C++0x/..) sau PCRE (Perl/PHP/..).PS:Din lista aia de pe wikipedia, am extras urmatoarele nume:[ "Salamon", "Salan", "Salatan", "Salenciuc", "Salmen", "Sarafolean", "Sburlan", "Sculean", "Secelean", "Selcudean", "Seleu?an", "Sele?an", "Sele?tean", "Seliman", "Selincean", "Seli?can", "Seli?tean", "Selnicean", "Seplecan", "Setelecan", "Sâlhan", "Sâmp?lean", "Sâncelean", "Sânp?lean", "S?celean", "S?c?lean", "S?hlean", "S?lan", "S?lban", "S?lciuan", "S?lcudean", "S?lcu?an", "S?li?can", "S?li?tan", "S?li?tean", "S?lvan", "S?l?tioan", "S?l??an", "S?nduleac", "S?ndulean", "S?pl?can"] Edited August 4, 2015 by H3xoR Quote
Che Posted August 5, 2015 Author Report Posted August 5, 2015 Multumesc mult pentru ajutor amandorura ! Quote