Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


RegEx Search

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Wed May 20, 2009 9:34 am    Post subject: RegEx Search Reply with quote

I would like to do an RegEx Search and it is proberbly easy but I just can't find out how to. Can someone help me or point me into the right direction?

This is the match : "<p" followed by anything and finnished by "</p>"

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
DanielG
Expert Cheater
Reputation: 1

Joined: 13 May 2009
Posts: 130
Location: The Netherlands

PostPosted: Wed May 20, 2009 12:44 pm    Post subject: Reply with quote

At Regexpal(.)com you can try your regexp skills.

And at regular-expressions.info/examples(.)html you have "Grabbing HTML Tags" with an example very close to your wishes:

Quote:
<TAG\b[^>]*>(.*?)</TAG> Analyze this regular expression with RegexBuddy matches the opening and closing pair of a specific HTML tag. Anything between the tags is captured into the first backreference. The question mark in the regex makes the star lazy, to make sure it stops before the first closing tag rather than before the last, like a greedy star would do. This regex will not properly match tags nested inside themselves, like in <TAG>one<TAG>two</TAG>one</TAG>.

<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1> Analyze this regular expression with RegexBuddy will match the opening and closing pair of any HTML tag. Be sure to turn off case sensitivity. The key in this solution is the use of the backreference \1 in the regex. Anything between the tags is captured into the second backreference. This solution will also not match tags nested in themselves.
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Wed May 20, 2009 1:25 pm    Post subject: Reply with quote

<p>.*</p>
that worked in at the regex tester.

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Odecey
Master Cheater
Reputation: 1

Joined: 19 Apr 2007
Posts: 259
Location: Scandinavia

PostPosted: Wed May 20, 2009 1:27 pm    Post subject: Reply with quote

Here is a good place to start : The 30 minute Regex tutorial.
Example which I think should do what you require:
Code:
(?<=<p).*(?=</p>)

Tested with Expresso.

_________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren
Back to top
View user's profile Send private message MSN Messenger
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Wed May 20, 2009 1:46 pm    Post subject: Reply with quote

Thanks for all the replies however I can't do (?<=exp). How would I do that? It supposed to selected the text after exp.
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Wed May 20, 2009 5:25 pm    Post subject: Reply with quote

what regex matcher are you using

VB6? Vb.NET? C#? C++/Boost? Javascript? Java? PHP?


I use VB6.. and the default settings are very wrong it only matches the first match in VB6.. so these are the settings I use to match all..

I'd use IgnoreCase for <p> and <P> small and big tags.

Code:

Set myRegExp = New RegExp
myRegExp.MultiLine = False
myRegExp.IgnoreCase = True
myRegExp.Global = True

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Thu May 21, 2009 1:39 am    Post subject: Reply with quote

i like doing things the old way with a bunch of nested loops.
confusing, but i get it.

_________________
Back to top
View user's profile Send private message AIM Address
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu May 21, 2009 5:04 am    Post subject: Reply with quote

thanks for all nice replies Smile
I got it working now Smile

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites