Blog Posts - Regular Expression



Ekstraksi HTML dan Teks dengan Regex

Ekstraksi Umum Memisahkan antara tag HTML dengan teks di sekitarnya:var test = 'foo <a b="c">bar</a> baz <b> qux yo"s <c><d> wut?'; var results =...
by Hompimpa Alaihum Gambreng on Jul 6, 2016

2 ways to Split String with Dot (.) in Java using Regular Expression

You can use the split() method of java.lang.String class to split a String based on the dot. Unlike comma, colon, or whitespace, a dot is not a common delimiter to join String, and that's why beginner often struggles to split a String by dot. One...
by javarevisited on Feb 20, 2016

Parser Markdown Paling Sederhana

Dukungan Markup Mendukung hampir semua markup seperti yang dinyatakan dalam dokumentasi Markdown Extra, kecuali markup catatan kaki, abbreviasi, daftar definisi, tautan ber–referensi dan gambar...
by Hompimpa Alaihum Gambreng on Feb 5, 2016

The Location of the VSS on a 1996 Chevy Suburban

At one point in time, an inoperative speedometer meant one thing: you needed to replace your speedo cable. There were no other ill side effects. Cruise control – if you were lucky enough to have it – would still work because it was vacuum control...
by Auto Service and Repair Review on Jan 20, 2015

Using Regular Expression to Get Image URL in WordPress Post

Before using this tips, i used regular expression to show first image in a wordpress post. And now, i want to share simple snippet code to showing first image, of course using regular expression. This function will return image URL, so you can flexib...
by Fresh Web Dev on Sep 21, 2014

PHP Remove All Special Characters And Replace Spaces With Hyphens

This PHP function will use Regex (Regular expression) to remove all special characters and replace space with hyphens so your string only has letters and numbers. And then converts them all to lowercase. It makes your link friendly, good for SEO and...
by 4 Rapid Development on Mar 4, 2014

Mengambil URL Gambar Pertama dari Posting

Versi PHPfunction get_first_image_url($data, $default_url = null) { // Matched with `![alt text](IMAGE URL)` from Markdown file if(preg_match_all('/\!\[.*?\]\((.*?)\)/', $data, $matches)) { ... Bersambung ke http://hompimpaalaihumgambreng.b...
by Hompimpa Alaihum Gambreng on Mar 1, 2014

Regex untuk Validasi Tag HTML

<("[^"]*"|'[^']*'|[^'">])*> Cocok untuk pola ini:<input value='>'><input value='<'><a href="http://www.nama_web.com"><br>, <br/><input value="'"... Bersambung ke http://hompimpaalaihumgambreng.blogspot...
by Hompimpa Alaihum Gambreng on Feb 13, 2014

Regular expression for Email Validation in java with example (top level domain and subdomain)

Before learning how to write regular expression for email validation in java , we should understand the term email address . An email address identifies an email box to which email messages are delivered.There is a good site to  test , regular e...
by Java Hungry on Jan 30, 2014

Add line numbering to text file with prefix text on Linux with awk

  Recently I blogged a tiny article on how to add line numbering to ASCII text files with nl cmd. Today I needed to do the same line numbering, except I wanted to add a prefix text "R0" to each line number to match requirements of progra...

Linux: Delete empty lines from text file with sed, awk, grep and vim

As a system administrator, sometimes is necessary to do basic plain text processing for various sysadmin tasks. One very common task I do to remove empty lines in file. There are plenty of ways to do it i.e. – with grep, sed, awk, bash, perl et...

Konversi Angka Menjadi Format Mata Uang

Fungsi ini digunakan untuk mengubah deret angka menjadi pola mata uang dimana setiap tiga deret angka akan ditambahi sebuah titik atau koma setelahnya/sebelumnya, dimulai dari belakang:function... Bersambung ke http://hompimpaalaihumgambreng.blogspo...
by Hompimpa Alaihum Gambreng on Dec 21, 2012

Syntax Highlighter dengan PRISM

Meskipun di blog ini Saya menggunakan syntax highlighter dari Software Maniacs, tapi jika diminta untuk memilih dari segi kecepatannya, maka Saya akan menggunakan PRISM, sebuah syntax highlighter... Bersambung ke http://hompimpaalaihumgambreng.blogs...
by Hompimpa Alaihum Gambreng on Sep 19, 2012

Mendapatkan Nama File dari URL

function getTitle(str) { var a = str.lastIndexOf('/') + 1, b = str.lastIndexOf('.'); str = decodeURIComponent(str.substring(a, b)); str = str.replace(/[\+\-\_]/g, " "); return... Bersambung ke http://hompimpaalaihumgambreng.b...
by Hompimpa Alaihum Gambreng on Sep 19, 2012

How to search text strings only in hidden files dot (.) files within a directory on Linux and FreeBSD

If there is necessity to look for a string in all hidden files with all sub-level subdirectories (be aware this will be time consuming and CPU stressing) use:   hipo@noah:~$ grep -rli 'PATH' .* ./.gftp/gftprc ./.gftp/cache/cache.OOqZVP &...

How to search text strings only in hidden files dot (.) files within a directory on Linux and FreeBSD

If there is necessity to look for a string in all hidden files with all sub-level subdirectories (be aware this will be time consuming and CPU stressing) use:   hipo@noah:~$ grep -rli 'PATH' .* ./.gftp/gftprc ./.gftp/cache/cache.OOqZVP &...

Validasi username dengan regular ekspresion

Sederhananya tinggal gunakan pattern ini : ^[a-z0-9_-]{3,15}$ Penjelasan pattern ^ Awal baris [a-z0-9_-] daftar karakter yang harus dipenuhi, a-z, 0-9, _ , - {5,15} panjang karakter, minimal 5 dan maksimal 15 $ Akhir baris contoh di PHP : function is...
by Si Jugul Pengen Gemuk on Mar 16, 2012


Trending Topics

Close