Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Your Regex Brain

Reply
Thread Tools

Your Regex Brain

 
 
Xah Lee
Guest
Posts: n/a
 
      03-24-2012
〈Your Regex Brain〉
http://xahlee.org/comp/your_regex_brain.html

Yours truely,

Xah
 
Reply With Quote
 
 
 
 
sln@netherlands.com
Guest
Posts: n/a
 
      03-27-2012
On Sat, 24 Mar 2012 16:30:28 -0700 (PDT), Xah Lee <(E-Mail Removed)> wrote:

>?Your Regex Brain?
>http://xahlee.org/comp/your_regex_brain.html
>


That's more like a brain cell.
This is more like a regex brain.

'
<img
(?=\s)
(?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) width \s*=
(?: (?> \s* ([\'"]) \s* (?<WIDTH>.*?) \s* \g{-2} )
| (?> (?!\s*[\'"]) \s* (?<WIDTH>[^\s>]*) (?=\s|>) )
)
)
(?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) src \s*=
(?: (?> \s* ([\'"]) \s* (?<SRC>.*?) \s* \g{-2} )
| (?> (?!\s*[\'"]) \s* (?<SRC>[^\s>]*) (?=\s|>) )
)
)
(?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) height \s*=
(?: (?> \s* ([\'"]) \s* (?<HEIGHT>.*?) \s* \g{-2} )
| (?> (?!\s*[\'"]) \s* (?<HEIGHT>[^\s>]*) (?=\s|>) )
)
)
(?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) alt \s*=
(?: (?> \s* ([\'"]) \s* (?<ALT>.*?) \s* \g{-2} )
| (?> (?!\s*[\'"]) \s* (?<ALT>[^\s>]*) (?=\s|>) )
)
)
(?> \s+ (?:".*?"|\'.*?\'|[^>]*?)+ > ) (?<!/>)
'

-sln

 
Reply With Quote
 
 
 
 
Peter J. Holzer
Guest
Posts: n/a
 
      03-27-2012
["Followup-To:" header set to comp.lang.perl.misc.]
On 2012-03-27 00:02, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:
> This is more like a regex brain.
>
> '
><img
> (?=\s)
> (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) width \s*=
> (?: (?> \s* ([\'"]) \s* (?<WIDTH>.*?) \s* \g{-2} )
> | (?> (?!\s*[\'"]) \s* (?<WIDTH>[^\s>]*) (?=\s|>) )
> )
> )
> (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) src \s*=
> (?: (?> \s* ([\'"]) \s* (?<SRC>.*?) \s* \g{-2} )
> | (?> (?!\s*[\'"]) \s* (?<SRC>[^\s>]*) (?=\s|>) )
> )
> )
> (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) height \s*=
> (?: (?> \s* ([\'"]) \s* (?<HEIGHT>.*?) \s* \g{-2} )
> | (?> (?!\s*[\'"]) \s* (?<HEIGHT>[^\s>]*) (?=\s|>) )
> )
> )
> (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) alt \s*=
> (?: (?> \s* ([\'"]) \s* (?<ALT>.*?) \s* \g{-2} )
> | (?> (?!\s*[\'"]) \s* (?<ALT>[^\s>]*) (?=\s|>) )
> )
> )
> (?> \s+ (?:".*?"|\'.*?\'|[^>]*?)+ > ) (?<!/>)
> '


"This is your brain on drugs."

SCNR,
hp


--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | (E-Mail Removed) |
__/ | http://www.hjp.at/ | -- Bill Code on (E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Your Regex Brain Xah Lee Python 2 03-27-2012 12:40 PM
left brain and right brain permutations pataphor Python 0 06-14-2009 07:14 PM
How make regex that means "contains regex#1 but NOT regex#2" ?? seberino@spawar.navy.mil Python 3 07-01-2008 03:06 PM
Need to borrow your brain for large <table> RC XML 3 12-07-2005 03:47 PM
Need to borrow your brain for large <table> RC Java 8 12-07-2005 03:47 PM



Advertisments