• 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 convertisseur css debian Debug débutant email english facebook firefox Français github IE Images intermédiaire 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 Windows wordpress À bookmarker

Méta

  • Flux RSS
  • Administration

Recent Entries

  • Freebox Player API
  • Windows Movie Maker pour Windows 7, Windows 8.1 et Windows 10
  • Mise à jour d’un serveur Kimsufi (OVH) depuis Debian 9 (Stretch) vers Debian 10 (Buster)
  • Connectivity issue with Qualcomm QCA61x4A 802.11ac in 5GHz
  • Let’s Encrypt Certificate: how to remove a domain from a certname that contains several domains
  • Upgrade from MySQL (5.6.40 – Debian 9.12) to MariaDB
  • Sharepoint error message “Invalid URL argument” with WebPartPages
  • chrome-search://local-ntp/local-ntp.html makes Chrome unresponsive
  • Our system has detected an unusual rate of unsolicited mail originating from your IP address
  • Sharepoint REST API to index a column or delete a column and more…

Recent Comments

  • 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…
  • liriarte in Execute an action before saving a form but after t…
  • Aymeric in Contrôler la Freebox avec Google Home
  • Jolaclass in Contrôler la Freebox avec Google Home
  • Aymeric in Bien configurer eMule [Astuces]
  • Random Selection of Posts

    • Sharepoint Workflow: Check if a field is empty [Sharepoint 2010]
    • Bien télécharger sur eMule [Astuces]
    • Utiliser .htaccess pour rediriger selon le referer [Apache]
    • Algorithmes de tri [Programmation]
    • Alternatives à IMNRC() et ProcessImn() pour déterminer la présence d’une personne [Sharepoint]
    • SharepointPlus 2.5.1 released [announcement]
    • Upgrade from MySQL (5.6.40 – Debian 9.12) to MariaDB
© 2008 Kodono is proudly powered by WordPress
Theme designed by Roam2Rome