AutoHotkey | Android | Arduino | COMM140 | Fractals | Grammar Checkers | Knots | A Million Dots Activity | Processing | Processing for Scratch Users | Redbubble | Tutorials | Weather | World Time Meeting Planner | Favicon Generator.
Home > Tutorials > Regular Expressions
According to the Wikipedia:
A regular expression is a string that describes or matches a set of strings, according to certain syntax rules. Regular expressions are used by many text editors and utilities to search and manipulate bodies of text based on certain patterns.
For a set of useful looking tools see http://global-search-and-replace.qarchive.org/
One of the most powerful features of Regular Expressions is Negative lookahead used to match something not followed by something else.
Editor | URL | Comments |
EditPad Pro | Home page http://www.editpadpro.com/download.html |
EditPad Pro's regex flavor is almost identical to the one used in Perl 5. Only the extensions that only make sense in a programming language are not available. All regex operators explained in the tutorial on this website are available in EditPad Pro. EditPad Pro integrates with RegexBuddy. You can instantly fire up RegexBuddy to edit the regex you want to use in EditPad Pro, or select one from a RegexBuddy library. |
jEdit | http://www.jedit.org/ | GNU General Public License. |
Note Tab Pro | http://www.notetab.com/ | Very powerful disk wide search and replace feature |
Text Pad | http://www.textpad.com/ | Nice clean interface. Not able to search for regular expressions within files see WildEdit or Note Tab if you want to do a global search and replace on a set of files. |
WildEdit | http://www.textpad.com/products/wildedit | I have yet to use this tool but it sounds like it does a similar job to the Note Tab Pro An interactive tool for power users to edit a set of text files in a folder hierarchy, filtered by wildcards. This makes it ideal for editing web pages and software source code, or reformatting log files and newsletters. |
EngInSite Perl Editor Lite (2,77 MB) - Free! |
Search | Replace | Examples | Use |
<a name="(.*)"> | <a name="XSLTpbhabcabcbbcabca"> <a name="a-b-a-d-"> |
To match anchor tags in a HTML document | |
<a name=".*">\n.*</a>\n | <a name="a-b-a-d-"> |
match anchor tag with closing <\a> on following line |
|
<td(.*)> | <td style="padding: 0in 5.4pt; width: 144.65pt;" valign="top" width="241"> |
to match style tags used in tables | |
^(.) | $1) | Used when converting Word documents to Aiken format Change the following list: A Moodle into this:
|
|
B\) =(.*)\r\n(.*)\r\n(.*)\r\n(.*)\r\n | B) =$1\r\n$2\r\n$3\r\n$4\r\nANSWER: B |
|
An eviscerated bowel should be managed by:
Assist with converting from GIFT to Aiken format quetions |
Expression | Examples | Comments |
perl -0777 -pi -e 's/<\/?FONT[^>]*>//gi' filename |
||
# remove font tags s/<\/?FONT[^>]*>//gi; |
Replaces this : <font size=2>Hi there. <b>Hey! I'm bold!</b> Plain again.</font> With this : Hi there. <b>Hey! I'm bold!</b> Plain again. |
Thanks to |
Perl Cheat Sheet Includes:Functions, Comparison Operators,Regular Expressions, Variable and Special Variables and Command-line options |
A Perl function is a group of statements used to perform a specific task. It allows users to divide their code into separate parts to reuse the code defined in the function. Perl comes with a wide range of command-line options that can be used to turn on or turn off different behaviors. You can create one-off command-line scripts to make your programs more concise. |
See ClipWriter http://www.dataomega.com/ClipWriter/
Expression | Examples | Use |
^!Replace "(^\w\w)\w* (\w*)" >> $1$2 RWAS | Replace: Sarah Kelly With: SaKelly |
To make user names from full names
|
Perl Ports (Binary Distributions)
Perl regular expression examples
APA citation:
Russell, R. (2023, January 25, 08:43 am). REgular expressions.
Retrieved November 18, 2024, from http://www.rupert.id.au/tutorials/regular-expressions/index.php
Last refreshed: November 18 2024. 11:16.46 pm
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.