Je vais avoir le texte ci-dessous.Correspond à plusieurs lignes usent Regex
^0001 HeadOne
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
^0002 HeadTwo
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
^004 HeadFour
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
^0004 HeadFour
@@
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of typeand scrambled it to make a type specimen book.
Voici l'expression rationnelle que j'utilise pour trouver.
@@([\n\r\s]*)(.*)([\n\r\s]+)\^
mais cela ne rattrape ^0001
et ^0003
que ceux-ci ont un seul paragraphe, mais dans mon texte il y a des contenus multi para.
J'utilise le code VS, quelqu'un peut-il s'il vous plaît laissez-moi savoir comment puis-je capturer ces multi-chaînes en utilisant REGEX dans le code VS ou NPP.
Merci
\ s est habituellement un espace, j'essayerais de supprimer cela ou d'ajouter un * pour indiquer zéro ou plus –
Quelles sont les correspondances attendues et pourquoi? @Calvin, dans VSCode, '\ s' ne correspond pas aux nouvelles lignes. Comment pouvez-vous définir la limite de fuite? Est-ce que '@@' est toujours au début de la ligne? –
@ WiktorStribiżew il correspond directement lorsque vous utilisez '@@' – user3872094