jjj Posted June 7, 2006 Share Posted June 7, 2006 (edited) i am trying to return the line shown below, which is in a text file along with hundreds of other lines of data: The Sopranos @ s06e12 @ Kaisha @[ 04-Jun-2006 ]using this search string:The Sopranos - Kaisha .mpgI know I can do this with string in string, but I want to use reg. expressions so i can add some fuzzy logic into it eventually. Note that there is a space bofre the line of text in the first line shown, but not in the second line, but there is a space after the episode name and before the ".mpg".Can anyone help me?EDIT: I figured out the regexp for this(i attached the code below), but it there a way to match case insensitive?, and how would i do it letter by letter or word by word? (so i can have it return a match if for example the search string was "the sopranos - the kaisha .mpg" (notice the "the" in the episode name, and the case of the whole string)here is my initial code:$filename = StringSplit("The Sopranos - Kaisha .mpg", " - ", 1) $showname = $filename[1] $episodename = $filename[2] $episodename = stringsplit($episodename, " .", 1) $episodename = $episodename[1] $listfile = fileopen("c:\program files\wget\test.txt", 0) While 1 $line = FileReadLine($listfile) If @error = -1 Then ExitLoop ;MsgBox(0,"",":"&$showname&":") ;MsgBox(0,"",":"&$episodename&":") ;MsgBox(0,"",$line) if StringRegExp($line, $showname) = 1 Then if StringRegExp($line, $episodename) = 1 Then ExitLoop EndIf EndIf Wend MsgBox(0,"",$line) Edited June 7, 2006 by jjj Link to comment Share on other sites More sharing options...
exodius Posted June 7, 2006 Share Posted June 7, 2006 See if this Post helps you out. Link to comment Share on other sites More sharing options...
Uten Posted June 8, 2006 Share Posted June 8, 2006 Somthing like this? Msgbox(0,"",StringRegExp("The Sopranos @ -- Found KasAThoy", "(.*(?i)sopranos.*kasa(?i).*)")) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
jjj Posted June 15, 2006 Author Share Posted June 15, 2006 (edited) Thanks! (27) addepisode_v0.41.zip Edited June 18, 2006 by jjj Link to comment Share on other sites More sharing options...
jjj Posted July 19, 2006 Author Share Posted July 19, 2006 (edited) timetest.zip Edited August 4, 2006 by jjj Link to comment Share on other sites More sharing options...
jjj Posted September 16, 2006 Author Share Posted September 16, 2006 (edited) Edited October 4, 2006 by jjj Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now