Welcome To Snipplr
Everyone's Recent Snippets Tagged regex
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Renames all the files in the working directory from given regex pattern, in this case removes a series of digits (e.g. \_0004\_) that Photoshop appends when exporting layers.
1
1555
posted 8 years ago by evito
* Usefull as shell command and everyting else
`get-ip='egrep -o "[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}"'`
`get-ipport='egrep -o "[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}[0-9 :]+" | sed -e "s/ //g"'`
0
1175
posted 9 years ago by dbiesecke
Regular Expression to find native Javascript console and AngularJS $log log warn or info that are NOT comments / commented out
1
1428
posted 9 years ago by brandonjp
[The original problem was stated as a SQL (SQL Server 2008) problem. This Perl script demonstrates the desired outcome for the problem statement.]
PROBLEM STATEMENT:
Please help me with SQL Query and requirement is as below:
Below is the Da...
0
1206
posted 10 years ago by bvwatson
Uses regular expressions to do string manipulation. Enter a regular expression into the required parameter and what you want the manipulation to do and it will process the string manipulation. For example if A1 contains John Doe1, Jane Doe2, John W...
2
1435
posted 10 years ago by BDOGG32
Search and returns the first results on a regex search
If we use parenthesized or subpattern, can return with $result_number
0
1148
posted 10 years ago by jatubio
Build a regex expression to all array elements are present in any order.
Gets an array of strings (Sample: array("Access Denied","error","could not be retrieved")
Return sample: '(?=.*Access Denied)(?=.*error)(?=.*could not be retrieved)
0
1205
posted 10 years ago by jatubio
Replaces spaces by '\s+' which means one or more spaces
$string can be one string or one array of strings
0
1117
posted 10 years ago by jatubio
Get all links from a website
from: http://www.pythonforbeginners.com/code/regular-expression-re-findall
0
2456
posted 10 years ago by tionazo
**Example of use:**
if (!isUniversityEmail('[email protected]'))
exit('You must have a valid and .edu email address to register for an account.');
1
1270
posted 11 years ago by phpdev
I want to extract the numbers from a string that contains numbers and letters like
0
1597
posted 12 years ago by satie83
Removes any lines from the file that don't start with "ERROR"
1
1077
posted 12 years ago by gamerzfuse
The following code retrieves a list of content based on a taxonomy id. The list is bound to a repeater that display a preview of the content with a quick link to a content page. The content comes in based on the previous taxonomy id but exposes a con...
0
1206
posted 12 years ago by dego89
It removes all standard C-style comments(/* 1-n */) and all single line comments("//"). Greedy matching.
0
1355
posted 12 years ago by XtreamIT
ต้à¸à¸‡à¸¡à¸µà¸à¸¢à¹ˆà¸²à¸‡à¸™à¹‰à¸à¸¢ 8 ตัวà¸à¸±à¸à¸©à¸£
ต้à¸à¸‡à¸¡à¸µà¸•ัวà¸à¸±à¸à¸©à¸£à¸à¸±à¸‡à¸à¸¤à¸©à¸•ัวเล็ภ[a-z] à¹à¸¥à¸°à¸•ัวใหà¸à¹ˆ[A-Z] à¸à¸¢à¹ˆà¸²à¸‡à¸™à¹‰à¸à¸¢à¸à¸¢à¹ˆà¸²à¸‡à¸¥à¹ˆà¸°...
0
1097
posted 12 years ago by gaserland
https://gist.github.com/4098493
(examples of use below the class code)
This class allows you to load a file of snippets that are really mini-templates copy them from your repository fill the token slots in them the with your data and render them as...
0
1231
posted 12 years ago by halk
thanks to...
http://gskinner.com/RegExr/
http://daringfireball.net/2010/07/improved_regex_for_matching_urls
1
2720
posted 12 years ago by brandonjp
As portrayed by the example found in the [Advanced Bash Scripting guide](http://tldp.org/LDP/abs/html/here-docs.html) this demonstrates a few techniques
0
1088
posted 12 years ago by symsec
As portrayed by the example found in the [Advanced Bash Scripting guide](http://tldp.org/LDP/abs/html/here-docs.html) this demonstrates a few techniques
0
1051
posted 12 years ago by symsec
A regular expression for removing <br> and <br> (case insensitive) between HTML elements if there is no content between the HTML elements. It was written for fixing extra line spaces created in a WordPress visual editor after the content of the visu...
0
1078
posted 13 years ago by pumpkinthehead
Formats a 10-digit phone number into a good format (123) 555-1234
0
1685
posted 13 years ago by cpres