RegExp - exec - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: RegExp - exec (/showthread.php?tid=76932) RegExp - exec by davidpolitis on 08-22-2007 at 10:35 AM
I need some help with RegExp, for some reason the code bellow isn't working. Can someone please help me? code: It's simply just plain not working at all! Thanks in advance, David. RE: RegExp - exec by phalanxii on 08-22-2007 at 11:14 AM If you want a quick fix, try: code:But just as an explanation, when you use the new RegExp("...") notation, your regular expression is taken from what it appears as a string. That means new RegExp("\\\\a\\\\") works the same as /\\a\\/, both of which capture a string which displays as \a\. My regular expression captures a group of letters that are not slashes up to a full-stop. Be aware that if there are no matches though, your script will have an error. RE: RegExp - exec by davidpolitis on 08-22-2007 at 11:21 AM
Mate, it won't go to the last dot after the last slash, it'll go to the first it runs into so it isn't help me much. Do you have any idea how to fix that? code: RE: RegExp - exec by markee on 08-22-2007 at 11:29 AM
code: If you are using the file using an ActiveXObject (The Scripting.FileSystemObject specifically) then you can just use .Name property. RE: RE: RegExp - exec by davidpolitis on 08-22-2007 at 11:33 AM
quote:Now that you mention it... I never thought about that Maybe someone else will find the code useful. Anyway, thank you guys for all the support and help. |