Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Delimiter
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Regular expression syntax ==== {{see also|Regular expression examples}} In specifying a [[regular expression]], alternate delimiters may also be used to simplify the syntax for '''match''' and '''substitution''' operations in [[Perl]].<ref name="Friedl000">{{cite book | last = Friedl | first = Jeffrey | title = Mastering Regular Expressions | publisher = Oxford University Press | location = Oxford Oxfordshire | year = 2006 | isbn = 978-0-596-52812-6 }} page 472.</ref> For example, a simple match operation may be specified in Perl with the following syntax: <syntaxhighlight lang="perl"> $string1 = 'Nancy said "Hello World!" to the crowd.'; # specify a target string print $string1 =~ m/[aeiou]+/; # match one or more vowels </syntaxhighlight> The syntax is flexible enough to specify match operations with alternate delimiters, making it easy to avoid delimiter collision: <syntaxhighlight lang="perl"> $string1 = 'Nancy said "http://Hello/World.htm" is not a valid address.'; # target string print $string1 =~ m@http://@; # match using alternate regular expression delimiter print $string1 =~ m{http://}; # same as previous, but different delimiter print $string1 =~ m!http://!; # same as previous, but different delimiter. </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)