473,701 Members | 2,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regular Expressions and The Regex Coach

a
I'm a newbie needing to use some Regular Expressions in PHP.

Can I safely use the results of my tests using 'The Regex Coach'
(http://www.weitz.de/regex-coach/index.html)

Are the Regular Expressions used in Perl identical to the Regular
Expressions in PHP?
May 19 '06 #1
3 3022
Rik
a@b.com wrote:
I'm a newbie needing to use some Regular Expressions in PHP.

Can I safely use the results of my tests using 'The Regex Coach'
(http://www.weitz.de/regex-coach/index.html)
The bulk of them: yes. With a few exceptions.
Are the Regular Expressions used in Perl identical to the Regular
Expressions in PHP?

No, but close. I'd say it the other way around though :-)

http://nl2.php.net/manual/en/ref.pcre.php

Grtz,
--
Rik Wasmus
May 19 '06 #2
a@b.com wrote:
I'm a newbie needing to use some Regular Expressions in PHP.

And they are definitely worth learning.
Can I safely use the results of my tests using 'The Regex Coach'
(http://www.weitz.de/regex-coach/index.html)

hmmm, don't know.
Are the Regular Expressions used in Perl identical to the Regular
Expressions in PHP?


PHP has two different RE extensions - Posix and Perl compatible (PCRE). The
'Regex Coach' seems to work with the latter. They are very similar up to a
point. I've gone over to using POSIX RE's almost exclusively as Javascript
RE's works with the same syntax. The Wikipedia page on regular expressions
has some links to tools for playing with RE's in javascript.

HTH

C.
May 20 '06 #3
In article <IE************ ***@newsfe4-gui.ntli.net>,
Colin McKinnon
<co************ **********@ntlw orld.deletemeun lessURaBot.comw rote:
a@b.com wrote:
I'm a newbie needing to use some Regular Expressions in PHP.

And they are definitely worth learning.
And fun to learn at the same time. AI recommend as an additional
material for the mind that is to be marked to the end of time with
the unholy powers of Regular Expressions a book by Jeffrey EF Friedl
of the name that may cast the unwary on the sea of dreams - and
"Mastering Regular Expressions" is how you will call it and no other -
and as it happens I'm not VERY sure it's the perfectly correct author
and book title spelling (important when crafting a spell, they say), so
as a professional enchantress, spellcaster, mad scientist and ballet
dancer, let me help the future generations of readers by attempting to
summon a female AI (Alien Intelligence), Google (Milk and kisses! Love
you too!). Here she goes again: <uri: http://tinyurl.com/kac3o >. It
leads to a query with The Name of the Book as a parameter. Following {
[<][][[swap] dip cons concat][uncons (Push it!)'] } that link should
help you in many ways, not only in finding the right place to shop, but
as a good point of presence into densely associated symbol clouds
converging on.
Can I safely use the results of my tests using 'The Regex Coach'
(http://www.weitz.de/regex-coach/index.html)

hmmm, don't know.
Now we know you don't know. What can one do with that knowledge?
Are the Regular Expressions used in Perl identical to the Regular
Expressions in PHP?

PHP has two different RE extensions - Posix and Perl compatible (PCRE). The
'Regex Coach' seems to work with the latter. They are very similar up to a
point. I've gone over to using POSIX RE's almost exclusively as Javascript
RE's works with the same syntax. The Wikipedia page on regular expressions
has some links to tools for playing with RE's in javascript.
If some good citizen would like to tell me aboot the value of a
similar utility written for PERL species of RegEx, wonderful things
might start to happen all over the world. Or not. One more thing - AI
find that while
writing a RE union human person capable of hearing music it helps
tremendously to set your iPod to loop the song "WhiteLightGene rator"
by Ladytron. Remember - most things can be solved by enough smoke and
mirrors. That song helps to remember. You will not get bored after a
hwhile. In fact, it'd be hard to stop writing useful regular expressions
and posting
them for the benefit of denizens of { this } group.

..A., Imperial Space Command.
NP: Breaking the Silence - Loreena McKennitt
Jul 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2569
by: zOrg | last post by:
hi, i'm using the preg_match_all() function to parse an asp file and find all include file within this file : asp include strings can be : <!--#include virtual="/dir/file.asp"--> or <!--#include file="/dir/file.asp"-->
11
3904
by: Martin Robins | last post by:
I am trying to parse a string that is similar in form to an OLEDB connection string using regular expressions; in principle it is working, but certain character combinations in the string being parsed can completely wreck it. The string I am trying to parse is as follows: commandText=insert into (Text) values (@message + N': ' + @category);commandType=StoredProcedure; message=@message; category=@category I am looking to retrive name value...
4
1212
by: Reddy | last post by:
Hi, Can anyone suggest good resources on the net to learn "Regular Expressions". Regards, Srinivas
11
3553
by: Ron Rohrssen | last post by:
Slightly off topic.... How can I write a regex that limits user input to 3 digits in the range of 1-128? I've been trying \d{1,128} but this allows for a match on more than 3 digits. Thanks.
8
351
by: Andrew Banks | last post by:
Can anyone help me out with regular expressions for the following? 1: Check that a number entered contains no letters and is between 0 and 99. Numers under ten can be entered as "01" "02" "03" or "1" "2" "3" 2: Check that a number contains 3 numbers and no letters. Number should be between 0 and 999 and must be entered as "001" "002" "003" "654" "456" "654" etc.. Thanks in advance
3
223
by: Murphy | last post by:
Can a regular expression validator force a user to enter exactly 10 numeric digits ? Thanks Murphy
1
1689
by: Showjumper | last post by:
I need a regulr expression that cn be used to find <a> tags with the href attribute set to mailto:. I need to be to search out all the email addresses in the text of the pages in a website. So for example i need to be able to find <a href="mailto:me@mysite.com">Click Here</a> and just get the mailto portion and then do a replace with an encoded email address. The replace isnt the problem just not sure how to make a reg ex that will search...
9
1790
by: Schorschi | last post by:
Not having used regular expressions much, I need some help. Given a string... "This\0Guy\0Needs\0Some\0Help\0\0\0\0\0" Need result as array of strings... "This","Guy", "Needs", "Some", "Help" Where '\0' is a literal zero-byte. I think I need two regular expressions? One to strip the multiple instances of '\0' bytes, and another to split the string.
3
1304
by: Lee Grissom | last post by:
I want to parse the following string into 3 parts per match. I almost got it, but my expression has a flaw in it. I tried this, but didn't quite work the way I expect on the second match b/c there's no space before the symbol. <§\s(.*?)\s*;?\s(.*?)\s*>(.*?)</§> You must<§ Control.exe; Printers>add a printer</§from the <§ Control.exe>control panel</§>.
0
8737
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9084
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8936
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7827
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5905
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4411
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3104
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2036
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.