 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
eXistenZ Guest
|
Posted: Wed Nov 28, 2007 10:21 am Post subject: [RegExMatch] Notworking when passing a variable? |
|
|
When I try this:
| Code: | RegExMatch(" Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 0:1 DAR 0:1], 25.00 fps(r)", "i)[0-9]{2,4}x[0-9]{2-4}", test)
MsgBox, %test% |
things work perfectly, i get 720x576 as a result.
When I try this however;
| Code: | dimensions = " Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 0:1 DAR 0:1], 25.00 fps(r)"
RegExMatch("%dimensions%", "i)[0-9]{2,4}x[0-9]{2-4}", test)
MsgBox, %test% |
the messagebox stays empty, and so does the %test% variable!
What am I doing wrong? I believe this is a bug.
Gtz,
eXistenZ from Holland |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Wed Nov 28, 2007 2:42 pm Post subject: |
|
|
| Code: | dimensions = " Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 0:1 DAR 0:1], 25.00 fps(r)"
RegExMatch(dimensions, "i)[0-9]{2,4}x[0-9]{2-4}", test)
MsgBox, %test% | ? |
|
| Back to top |
|
 |
eXistenZ Guest
|
Posted: Wed Nov 28, 2007 3:43 pm Post subject: |
|
|
| Doesn't seem to work... |
|
| Back to top |
|
 |
FGR Guest
|
Posted: Wed Nov 28, 2007 4:54 pm Post subject: Re: [RegExMatch] Notworking when passing a variable? |
|
|
| eXistenZ wrote: | When I try this:
| Code: | RegExMatch(" Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 0:1 DAR 0:1], 25.00 fps(r)", "i)[0-9]{2,4}x[0-9]{2-4}", test)
MsgBox, %test% |
things work perfectly, i get 720x576 as a result.
|
This code also does not work,there is a syntax error, you wrote "{2-4}" and not "{2,4}".
Correct it and Bobo's code will work. |
|
| Back to top |
|
 |
eXistenZ Guest
|
Posted: Mon Dec 03, 2007 11:29 am Post subject: |
|
|
the - isn't the problem i know i mistyped there Still not working... |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2472 Location: Australia, Qld
|
Posted: Mon Dec 03, 2007 12:33 pm Post subject: |
|
|
| Since '=' is for assigning literal text, the quote marks are included in the assigned value. Use ':=' to assign the string. |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Dec 03, 2007 12:41 pm Post subject: |
|
|
| It works for me,even with the "=" |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Dec 04, 2007 1:28 pm Post subject: |
|
|
| eXistenZ wrote: | | Still not working... | Works for me...
Note that = works but just includes the double quotes in the string. Which isn't a problem here. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|