RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

63 regular expressions found in this category!

Expressions in category: Markup/Code

Change page:   |    Displaying page 4 of 4 pages; Items 61 to 63
Title Test Details Pattern Title
Expression
^(Function|Sub)(\s+[\w]+)\([^\(\)]*\)
Description
Updated, changed [\w]* to [\w]+ because pattern should not match Sub (), there would be no function name which would be incorrect. Will extract function declarations from ASP or also VB I assume. Will even capture declarations that break across new lines or ones that use the underscore(line continuation character) in Microsoft's VB, VBA, ASP, etc. Had to put this together to document some code on a project and didn't see anything like it on the web. I hope it helps out anyone else who has to re-engineer ASP or VB code.
Matches
Function MyFunc(Arg1, Arg2, Arg3, Arg4)
Non-Matches
'This is a comment for MyFunc(Arg1,Arg2,Arg3) and this regexp wouldn't work.
Author Rating: Not yet rated. James Fal
Title Test Details Pattern Title
Expression
<([^<>\s]*)(\s[^<>]*)?>
Description
All tags in first submatche All attributes in second one...
Matches
<td class="TD2"> | <!-- comment --> | </table>
Non-Matches
19-Fev-2002 - 19h00 | New Changes : | ...
Author Rating: Not yet rated. Tanguy Pruvot
Title Test Details Pattern Title
Expression
<([^\s>]*)(\s[^<]*)>
Description
grab all tags attributes... &lt;img src=&quot;truc&quot;&gt; returns : &lt; (1:img) (2: src=&quot;truc&quot;) &gt; i use it to clean html pages to grab infos... use a RegEx Replace with &quot;&lt;$1&gt;&quot; to keep only tags codes...
Matches
<img src="truc"> | <body background='...'> | <p align='left'>
Non-Matches
<br> | </body> | <p>
Author Rating: Not yet rated. Tanguy Pruvot
Change page:   |    Displaying page 4 of 4 pages; Items 61 to 63

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials