Jump to content

How to put wildcard characters in a string?


Kidney
 Share

Recommended Posts

So im making a script that organizes TV shows. i have figured most of it out but im trying to find the portion of the title that contains the Season number and Episode number. (ie S01E13)

is there and easy way to search for the "S" and "E" in a string with any 2 random numbers in between them and after the "E"?

 

here is what i tried just as a very wild guess:

Func FindSeasonEpisode($FileName)
    $result = StringInStr($FileName, "S**E**")
    ConsoleWrite($result & @CRLF)
EndFunc
Link to comment
Share on other sites

Please have a look at StringRegExp.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

to be completely honest water, i would like to use stringregexp but i cant figure it out for the life of me.
if i had an example of how i would use it in this situation then i could probably mess with it enough to do more elaborate things but for now, tester123's solution works for me.
 
 
if you dont mind water, i would really like to see how i would use that function in my situation. if its not too much of a hassle.

 

@tester123 ty ty. this is what i was looking for :)

 

EDIT: tried the d but im getting a 0 for my results with StringInStr. when i do StringRegExp with the d's i get a 1 which is a match but how do i get the position like i do with StringInStr??

Edited by Kidney
Link to comment
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
 Share

×
×
  • Create New...