Sign in to follow this  
Followers 0
RogueX20

Can StringRegExp use a Variable?

7 posts in this topic

I want to read a line in a file, then that line gets passed to stringregexp.

Share this post


Link to post
Share on other sites



Of course! What would be its use on only litteral terms?

You can pass any string expression as subject and pattern.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Of course! What would be its use on only litteral terms?

You can pass any string expression as subject and pattern.

Figured. I am not getting an error, but I am not seeing the result either. Let me work on it some more. Thanks

Share this post


Link to post
Share on other sites

When you have a regex question it's a good practice to post the text you are attempting to parse and the result are are after as well as the expression you have tried. That will make it much easier for us to tell you what is wrong.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

When you have a regex question it's a good practice to post the text you are attempting to parse and the result are are after as well as the expression you have tried. That will make it much easier for us to tell you what is wrong.

Understood. I just wanted to check on that question as I wasn't getting an error. With confirmation it allowed me to dig a little more and I found the problem. I like to try a few things and make sure I am really stuck before I make a post and look silly. ;)

You and everyone else have been a great help in the short time I have been on this forum. The IT staff at my place like to feel big and mighty and I don't like making it a habit to give them reason to make me feel like an idiot. So I am taking that approach here as well. Do what I can before I put up what I put together. :huh2:

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Always try it yourself first but don't be afraid to ask for help when a piece of code fails in particular with RegEx. Any developer will tell you that (in any language or flavor) they are among the most difficult to learn. When you do learn them there will be a tendency to over-use them. Don't get tricked into that. Test for speed against normal string functions for a good reason why.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

BTW a very nice and useful test bed for your regexp is in GEOsoft signature.

The comfortable feature it has is that it relies on actual AutoIt regexp engine, so you don't have regexp "flavor" surprises any more.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0