GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
[WD22] Help with Regex
[WD22] Help with Regex
Iniciado por Wahib Hassaini, jul., 19 2018 3:38 PM - 2 respostas
Conecte-se…
Wahib Hassaini
#1
Publicado em julho, 19 2018 - 3:38 PM
Hello,
I'm having a hard time with regex.
I need to isolate parts with a certain color in a RTF field.
Here is my source :
Quote
{\
tf1\ansi\ansicpg1252\deff0\
ouicompat\deflang1033{\onttbl{\0\nil\charset0 Tahoma;}}
{\colortbl ;\
ed0\green0\lue0;\
ed64\green85\lue141;\
ed0\green30\lue196;}
{\*\generator Riched20 10.0.17134}\viewkind4\uc1
\pard\cf1 Elem1\cf2 Hello \cf3 Elem2\par
2nd Liane : \cf3 Elem3\cf2\par
\cf3 Elem4\cf2 3rd\cf3 Elem5\cf2 Line : \cf3 Elem6\cf2\par
4th Line : \cf1 Elem7\cf0\par
}
Here is my regex :
(?<=\\cf[13] ).*?(?=\\cf.)
It's working just fine on those sites :
https://regex101.com/
,
https://www.regextester.com/
,
https://regexr.com/
But not in Windev...
Do you have an idea why?
Thank you.
Denunciar
0
0
Fabrice Harari
#2
Publicado em julho, 19 2018 - 3:52 PM
Hi Wahib,
probably because supported regex expressions in wlanguage are way less advanced than on these web sites.
You can certainly ask the support about the difference in behavior for a definite answer about it.
Best regards
Denunciar
0
0
Tim
#3
Membro registado
34 mensagems
Popularité : +3 (3 votes)
Publicado em julho, 20 2018 - 2:27 PM
Hi,
check out these links:
https://forum.pcsoft.fr/fr-FR/pcsoft.us.windev/45571-wd18-need-help-with-regular-expression/read.awp
https://forum.pcsoft.fr/fr-FR/pcsoft.fr.windev/95095-expressions-regulieres-regex-cherche-remplace/read.awp
s
Text
is string
= [
{\
tf1\ansi\ansicpg1252\deff0\
ouicompat\deflang1033{\onttbl{\0\nil\charset0 Tahoma;}}
{\colortbl ;\
ed0\green0\lue0;\
ed64\green85\lue141;\
ed0\green30\lue196;}
{\*\generator Riched20 10.0.17134}\viewkind4\uc1
\pard\cf1 Elem1\cf2 Hello \cf3 Elem2\par
2nd Liane : \cf3 Elem3\cf2\par
\cf3 Elem4\cf2 3rd\cf3 Elem5\cf2 Line : \cf3 Elem6\cf2\par
4th Line : \cf1 Elem7\cf0\par
}
]
s
Regex
is string
=
"(?<=\\cf[13] ).*?(?=\\cf.)"
cl
Matches
est un
MatchCollection
<
-
Regex.Matches
(
s
Text
,
s
Regex
)
POUR
TOUT
cl
Match
de
cl
Matches
Trace
(
cl
Match.value
)
//
POUR TOUT clGroup DE clMatch.groups
//
Trace(tab + clGroup.value)
//
FIN
FIN
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto