• Home
  • A Propos
  • Greasemonkey
  • HowTo GitHub
  • Performance JavaScript
  • SharepointPlus

18

Oct

Supprimer les tags <script> d’une chaine de caractères [javascript]

Posted by Aymeric  Published in Niveau débutant, Programmation

Il suffit d’utiliser la chaine RegEx suivante : var myText = ‘blah blah <script type= »text/javascript »>foo=bar;</script>blah blah’; var myStripText = myText.replace(/<script.*?>[\s\S]*?<\/.*?script>/gi, » »); console.log(myStripText); // -> ‘blah blah blah blah’ On peut également utiliser une expression régulière pour supprimer les liens javascripts : var myText = ‘blah blah <a href= »javascript:alert(gniii) »>foo</a>blah blah’; var myStripText = myText.replace(/javascript.*:[^ »]*/gi, » »); console.log(myStripText); // -> […]

Continue reading...

Tags: javascript, Niveau débutant, Programmation, regexp

no comment

2

Août

Utiliser la première occurrence dans une regexp [Javascript]

Posted by Aymeric  Published in Niveau intermédiaire, Programmation

[niveau: intermédiaire] Lorsque vous utilisez une expression régulière, cela va vous retourner un maximum de caractères, ainsi si nous prenons la chaine « foo:bar:gniii » avec la regexp /^(.*):(.*)$/, on va avoir « foo:bar » d’une part et « gniii » d’autre part. Alors comment faire pour obtenir la première occurrence de « : » dans notre chaine ? Il suffit d’ajouter le […]

Continue reading...

Tags: développement, javascript, Programmation, regexp

no comment

6

Mai

Tester des expressions régulières (RegExp) en ligne [Programmation]

Posted by Aymeric  Published in Niveau expert, Programmation

[niveau: expert] Vous connaissez certainement les RegExp. Lumadis.be propose de tester nos expressions régulières en utilisant les fonctions PHP preg_match, preg_match_all et ereg. Un outil en ligne bien pratique pour ces expressions parfois difficiles à formater ! EDIT: on notera aussi l’existence de cet autre outils en ligne très complet : http://gskinner.com/RegExr/

Continue reading...

Tags: Niveau expert, php, Programmation, regexp

no comment

Me Suivre

Suivre @aymkdn

Catégories

  • À bookmarker
  • Android
  • Application
  • Astuce
  • Debug
  • Divers
  • English
  • Français
  • Images
  • Linux
  • MacOS
  • Navigateur
  • Niveau débutant
  • Niveau expert
  • Niveau intermédiaire
  • Partage
  • Performance
  • Programmation
  • Sécurité
  • Téléphonie
  • Vidéo
  • Web Design
  • Windows

Étiquettes

android Application Astuce astuces css debian Debug email english facebook firefox Français github greasemonkey IE Images internet explorer javascript jquery Linux mysql Navigateur Niveau débutant Niveau expert Niveau intermédiaire Nokia Partage Performance php Programmation regexp sharepoint Sharepoint 2013 sharepointplus Sécurité traitement vidéo téléphone Téléphonie vidéo Web Design wifi Windows wordpress workflow À bookmarker

Méta

  • Flux RSS
  • Administration

Recent Entries

  • Get email address from a Azure DevOps « by » field in Power Apps Flow
  • Use CTRL and TAB to switch between two tabs in Chrome
  • Mise à jour d’un serveur Kimsufi (OVH) depuis Debian 10 (Buster) vers Debian 11 (Bullseye)
  • Portable version of NodeJS on Windows
  • Redirect non-www to www on a PHPBB Forum
  • Debug a third party Android APK
  • Capacitor Plugin for HTTP requests with self-signed SSL certificates
  • Enable CORS with IIS
  • L’application Android « Huawei Health » (ou « Santé » en français) retourne l’erreur : « les notifications sont indisponibles »
  • Problème d’accès avec C:\Program Files\WindowsApps

Recent Comments

  • towkneed in Check permissions in Sharepoint based on a PermMas…
  • L in Mise à jour d’un serveur Kimsufi (OVH) depuis D…
  • Aymeric in Utiliser un email alias avec GMail [Astuce]
  • Chris in Utiliser un email alias avec GMail [Astuce]
  • alex91 in Create a self-signed certificate for localhost tes…
  • Coolwriter in Bien configurer eMule [Astuces]
  • Nico in Bien configurer eMule [Astuces]
  • Jim1988 in Permettre le retour en arrière sur une page PHP a…
  • rikimaru11273 in Bien configurer eMule [Astuces]
  • Aymeric in Execute an action before saving a form but after t…
  • Random Selection of Posts

    • Decode Sharepoint unicode URL
    • Comment flouter une image [traitement d’image]
    • http://www.iegallery.com/addonsie7/ is returned when trying to change the default search engine for Internet Explorer
    • Root/directory, 0x8004100E – (WBEM_E_INVALID_NAMESPACE) Namespace specified cannot be found
    • Raphaëljs plugins for different charts [gRaphaël]
    • Load a script once a DispForm is fully shown in Sharepoint 2013
    • 10 conseils Facebook pour sa vie privée [A Bookmarker]
© 2008 Kodono is proudly powered by WordPress
Theme designed by Roam2Rome