Follow us on Twitter!
Society leans ever heavily on computers, if you have the power to take out computers you can take out society. - cubeman372
Friday, April 18, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 27
Guests Online: 26
Members Online: 1

Registered Members: 82828
Newest Member: uberscon
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-07-06 12:04
Does anyone know any good Regex generator scripts which would work for large strings. IE a regex which could test a whole script for a series of commands ie a script which would return

<?php echo "lol"; ?>
<?PHP echo "LOL"; ?>
<?php print "lol"; ?>
<?php echo "lol"; echo "meh"; ?>
.
.
.

as true but would return things like

<?php echo "loll"; ?> as false


Author

RE: Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-07-06 12:21
There is not really any good programs...Regex are always better when they are "Home made"...

But to test these regelura expresion, use the function preg_match




Author

RE: Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-07-06 12:29
I usually do do them "home-made" but try making a home made regex for 30-40 lines of code involving OR functions


Author

RE: Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-07-06 12:32
Shocklol... www.google.com ?


Author

RE: Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 13-07-06 14:03
Actually, it shouldn't be too difficult. . . Just put the code in some variable. . .

If it contains a lot of single and double quotes, construct it like:
Code

$code = <<<END

<?php

    // My Code here

?>

END;

 $regex = str_replace('/', '\/', preg_quote($code));

 echo preg_match("/^$regex$/", $code) ? 'Good' : 'Bad';






$regex = str_replace('/', '\/', preg_quote($code));

Should form the REGEX for you :)




Edited by on 13-07-06 14:04
Author

RE: Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 14-07-06 15:37
'/(<\?){1}(php|PHP){1}(.)([$][a-z])/'
'/(<\?){1}(php|PHP){1}(.)([$])[a-z]/'
'/(<\?){1}(php|PHP){1}(.)([$])([a-z])/'

None of theses preg_match <?php $a

But
'/(<\?){1}(php|PHP){1}(.)([$])/'

matches

<?php $

Help!!!


Author

RE: Regex


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 14-07-06 19:04
'/^\<\? php \$[a-Z]/i'

Try that. . .