how to use RegexBuddy? can you help me.

Reply

Join Date: Jul 2009
Posts: 3
Reputation: MrBaseball34 is an unknown quantity at this point 
Solved Threads: 0
MrBaseball34 MrBaseball34 is offline Offline
Newbie Poster

how to use RegexBuddy? can you help me.

 
0
  #1
Jul 5th, 2009
I use TRegExpr v.0.952 and now i want use RegexBuddy, but i can't replace code. Can u help me?
Pascal and Delphi Syntax (Toggle Plain Text)
  1. var
  2. Temp: TStringList;
  3. Index: Integer;
  4. regex: TRegExpr;
  5. begin
  6. Temp:= TStringList.Create();
  7. regex := TRegExpr.create();
  8. regex.Expression := '(?m)(?g)^ftp:.+';
  9. try
  10. for Index:= 0 to FList.Count - 1 do
  11. begin
  12. regex.exec(FList[index]);
  13. if (regex.Match[0] <> '') and (Temp.IndexOf(regex.Match[0]) = -1) then
  14. Temp.Add(regex.Match[0]);
  15. end;
i paste and replase code from RegexBuddy for delphi:
Regex := TPerlRegEx.Create(nil);
Regex.RegEx := '(?m)(?g)^ftp:.+';
Regex.Options := [preMultiLine];
but i've got a error Undeclared identifier: 'exec'
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 443
Reputation: FlamingClaw will become famous soon enough FlamingClaw will become famous soon enough 
Solved Threads: 106
FlamingClaw's Avatar
FlamingClaw FlamingClaw is offline Offline
Posting Pro in Training

Re: how to use RegexBuddy? can you help me.

 
0
  #2
Jul 6th, 2009
What about units....?
Do not forget to add TRegExpr into uses section of the unit.
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: MrBaseball34 is an unknown quantity at this point 
Solved Threads: 0
MrBaseball34 MrBaseball34 is offline Offline
Newbie Poster

Re: how to use RegexBuddy? can you help me.

 
0
  #3
Jul 6th, 2009
no. i use:
uses ..., PerlRegEx;
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 443
Reputation: FlamingClaw will become famous soon enough FlamingClaw will become famous soon enough 
Solved Threads: 106
FlamingClaw's Avatar
FlamingClaw FlamingClaw is offline Offline
Posting Pro in Training

Re: how to use RegexBuddy? can you help me.

 
0
  #4
Jul 6th, 2009
sorry this regexbuddy thing is new to me but I found a page
http://www.regular-expressions.info/delphi.html
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: MrBaseball34 is an unknown quantity at this point 
Solved Threads: 0
MrBaseball34 MrBaseball34 is offline Offline
Newbie Poster

Re: how to use RegexBuddy? can you help me.

 
0
  #5
Jul 6th, 2009
i know this site. and what?
i need a specific example or ... help
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 443
Reputation: FlamingClaw will become famous soon enough FlamingClaw will become famous soon enough 
Solved Threads: 106
FlamingClaw's Avatar
FlamingClaw FlamingClaw is offline Offline
Posting Pro in Training

Re: how to use RegexBuddy? can you help me.

 
0
  #6
Jul 6th, 2009
this is a section from the regexbuddy 3.0 user manual
The regex module provides the standard POSIX functions regcomp() for compiling a regular expression,
regerror() for handling compilation errors, regexec() to run a search using a compiled regex, and
regfree() to clean up a regex you’re done with.
--- --- ---
If you want to retrieve the part of the string that was matched, call the exec() function of the RegExp
object that you created, e.g.: mymatch = myregexp.exec("subject"). This function returns an array.
The zeroth item in the array will hold the text that was matched by the regular expression. The following
items contain the text matched by the capturing parentheses in the regexp, if any. mymatch.length indicates
the length of the match[] array, which is one more than the number of capturing groups in your regular
expression. mymatch.index indicates the character position in the subject string at which the regular
expression matched. mymatch.input keeps a copy of the subject string.

Calling the exec() function also changes the lastIndex property of the RegExp object. It stores the index
in the subject string at which the next match attempt will begin. You can modify this value to change the
starting position of the next call to exec().
Last edited by FlamingClaw; Jul 6th, 2009 at 4:50 pm.
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC