With regex, how can I combine backreference and repetition

Let's say I have a four byte long input string, consisting of four hex values:  0x03 0x03 0x03 0x03
If I use repetition in a regex string pattern: .{4}  it matches true.
Also, if I use backreference in a new regex pattern: (.)\1\1\1  it matches true.
But I want to combine the two.  Say that the first byte is a length byte of the following bytes.  Then I'd believe it should be possible to do this: (.).{\1}
The thought is that the first byte is stored as "variable" \1, and reused as the repetition counter.  So in this case, all four byte strings starting with 0x03 should match true.
But this doesn't work!
What am I doing wrong here?  Is this just not possible?

ojohnsen wrote:
No RegEx experts here?
I am not an expert, but I play one on this forum.  To show something is possible is quick, since you can demonstrate it.  To show something is impossible is a bit harder.  For now I say, not possible.  And you do realize that .{4} will match any four character string, not anything repeated four times, right?
That said, it sounds like you know the format of your string, so perhaps a regex would not be your first choice.  You could split a string, read the first byte, then construct a regex like ^(.)\1{length-1} and see if the remainder of the string begins with a value repeated length times.

Similar Messages

  • How can I combine Left and Right audio?

    Hi,
    When I record video, one lapel mic records to the left channel and the other records to the right channel in one audio track. I can't seem to figure out how to combine them within Premiere Pro (I've already attempted searching the forums for more info). I know in Sony Vegas you can right click the single audio track and select "Combine" and it will combine the 2 channels so that when people watch the end product you have both voices coming out of both speakers.
    Any help would be appreciated.
    Thanks
    Kelly G.

    Hello,
    Yes i have the same issue.
    I use the duplicate Audio track and fill left and right all the time.
    when i am doing Interview videos i usually have one person on channel 1 and the other on channel 2 and it comes out as L and R in Premiere.
    Today i was shooting with myself on Channel 2 and a shotgun for some ambient sound on channel 1.
    In Vegas or FCP 7 there is a simple effect to drag and drop called " Combine" that nicely combines the L and R channels each into stereo.
    I used to use it quite a bit and think it would be a great addition to Premiere Pro.
    So i am wondering several years since this was first post if Premiere does in fact now have this option...and where it might be that i over looked it?
    If not.....is there an easier way to do this than the fill left and right method?
    Thanks so Much!
    Mark

  • We have a large family, 5 kids and two adults all with iPads, iPhones, Mac Books, Servers....  How can we combine our purchases to use on all our devices.  We have two Apple ID's and sometimes buy multiple copies because of how we are limited...

    We have a large family, 5 kids and two adults all with iPads, iPhones, Mac Books, Servers....  How can we combine our purchases to use on all our devices.  We have two Apple ID's and sometimes buy multiple copies because of how we are limited...

    Hello Halfback71,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/ht5622
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
    Best of luck,
    Mario

  • I have three different ipods with music on them and have had to replace our computer as it was in a fire. How can we combine the ipods into one ipod.

    We had to replace our computer due to a fire and lost many of the fiels which were on them. Many were music files for the ipods, we have thre. Also, do not have ID's and passwords to the iTunes store.
    How can we combine the information so that they are all in each one or at least compbine everything into one ipod?

    Just so you know the method suggested by Nelsonleee will cost your $29.95 USD, Yamipod is free.

  • A music album is listed multiple times in my library but each listing only has a few songs in it-not the full listing.  How can I combine them into one album and get rid of other duplicate listings?

    Several music albums listed in my IPhone 5 music library are listed multiple times, but each one only has a portion of the songs listed.  How can I combine them to make one album?

    First....Thank you so much for your prompt reply.  I am sorry for not getting back to you regarding your suggestion-I had computer issues that just got resolved.  Also, this is my first foray into online chat rooms so I have a lot to learn to precisely state my issue!  I did as you suggested and all the songs list the same album when I go into each song's "get info".  However, I am not sure how to edit as you suggested. When I downloaded this album originally, for some reason it broke up into several albums each with different songs from the original album.  I am trying to consolidate them back into one album in my library.  I would greatly appreciate further assistance if you can.  Also, I do not use "the cloud" to store any data and would like a good source of info on how to do this.  Thanks so much for your patience!
    SueZoo

  • I bought 26 new songs under my work e-mail and now i can't copy them to my i-pod because it has another music library on it. How can i combine both user id's to the same purchased account

    I have 2 user id's with apple, i bought 26 songs from my laptop recently using my work e-mail. I plug my i-pod to sync it and it says that my i-pod is tuned with another library. i don't want to erase the songs I have already because they are about 760 and the new ones are 26 only. how can I combine both user id's and consolidate all the music into one user id?
    everytime i try to do something it asks me to reset the password. I have done it already 6 times.
    there is no phone # to call.
    Thanks
    Elena

    Alright, please follow these steps in order to get it working properly again.
    Please change your Apple ID back to your old email address (that you used as Apple ID before) here: http://appleid.apple.com
    Then go to all your devices - iPhones, iPads, Mac etc. - ("Settings > iCloud") and delete your iCloud account from this devices (+ turn off Find My iPhone, but I guess it will ask you that anyway)
    After that go back to http://appleid.apple.com sign in again, and now change your Apple ID again to your new email address.
    Finally, set up your iCloud account on all your devices again.
    Now, everything should working properly again.

  • How can i combine a b/w photo with a color photo? [was: Photoshop 5.5]

    How can i combine a b/w photo with a color photo?

    Edit the color document. Then Copy, or Place or Paste in the Grayscale image and mask the BW to create a composit.

  • How can I combine multiple animations. (Play another animation after one has finished with a click?)

    How can I combine multiple animations. (Play another animation after one has finished with a click?) Like a slideshow but with animations. any ideas?

    You can do this by calling up the different edge Animate composition html pages using buttons and an iframe:
    To get a general idea, put this in the body of an html page and insert your own URLs where indicated
    <iframe id="iframeID" src="yourFirstURL" width="640" height="480">
    <p>Your browser does not support iframes.</p>
    </iframe>
    <button onclick='loadIframe("iframeID", "firstAnimURL")'>First Animation</button>
    <button onclick='loadIframe("iframeID", "secondAnimURL")'>Second Animation</button>
    <button onclick='loadIframe("iframeID", "thirdAnimURL")'>Third Animation</button>
    <script>
    function loadIframe(iframeID,url) {
    //alert("Hello");
       document.getElementById("iframeID").src = url;
    </script>
    Peter Small

  • How can I combine animation from Flash with a video from Photoshop to make a movie?

    I have a project that's due tomorrow. I had to create a motion tween and animation and record a video to put in it, which I have done both already. My question here is, how can I combine my animation from flash and my video from Photoshop to make it into one movie?

    No, I am saying that this isn't the forum for help with that. This forum is for Firefox user support, and the helpers in this forum aren't versed in development issues like that - we're volunteers, not Mozilla developers and don't work for Mozilla. You are better off asking about that in a forum where other web site developers do support.

  • How can i keep mine and my husbands contacts from combining when syncing phone

    How can i keep mine and my husbands contacts from combining when syncing our phones

    Don't sync each iPhone with the same supported address book app on the shared computer.
    There are a number of free email accounts that support syncing contacts over the air such as with a free iCloud account, with a Yahoo account, Gmail account, and Hotmail account.
    Do that instead with different accounts for each of you and no longer sync contacts direct with a supported address book app on your computer.

  • How can I combine a lot of text and images on the same screen?

    How can I combine a lot of text and images on the same screen?  I can get a couple of words on the screen with a graphic but not 10 lines.  I need 10 lines on the page with the image. 

    Priscilla,
    I routinely combine 10 lines of 36 pt bible or lecture text to a suitable background using Boris Title 3D.
    Many times the text is too long to fit the screen using Boris, so I devide it into 2 or more parts with no transition between sections.
    In my case, the text is on the screen as the speaker quotes them.
    David

  • I have a htc wildfire, and if i try to install firefox from android market place it says that my device is not compatible with firefox. how can i install it ?

    i have a htc wildfire, and if i try to install firefox from android market place it says that my device is not compatible with firefox. how can i install it ?

    According to a random website... the HTC Wildfire S uses a Qualcomm MSM7225 processor. This processor unfortunately does not support the full ARM version 7 instruction set, so Firefox cannot run on it.

  • I have two Apple ID Accounts. How can I combine them so I can simplify updates and purchases?

    I have two Apple ID's (accounts). How can I combine these accounts into one so I can simplify updates and purchases?

    Sorry, but Apple IDs/iTunes Store accounts cannot be merged.
    Regards.

  • We have itunes music on a computer, an ipod nano, and a new ipod touch under two different accounts. How can we combine the music from both accounts to one device?

    We have itunes music on a computer, an ipod nano, and a new ipod touch under two different accounts. How can we combine the music from both accounts to one device?

    There is no "adding" a device.  Simply plug the iDevice into the computer.  iTunes should automatically detect the device when it is connected.
    iTunes can sync/manage as many iDevices as you want... there is no 1 device limit.

  • HT201269 when i back up my iphone 5 so that i have all the info from my 4s on it, it wont put my music on it or let me do anything with it. how can i get my itunes to recognize that it is my new iphone and let me put stuff on it with out completely resett

    when i back up my iphone 5 so that i have all the info from my 4s on it, it wont put my music on it or let me do anything with it. how can i get my itunes to recognize that it is my new iphone and let me put stuff on it with out completely resetting it?

    What version of iTunes are you running on your computer? You need to update to the current version.

Maybe you are looking for

  • Outlook E-mail address format on IPhone not correctly displayed

    I have MS Outlook 2007 and am synching my Outlook contact groups to my IPhone. Any of the contacts e-mail's in the groups that I created look normal on the IPhone, but I copied a bunch of contacts from our Public folder contacts group into my persona

  • 2 Airport Expresses

    I've been fighting with this for hours. I might have finally figured out what's wrong. I have 2 Airport Expresses. I'm trying to extend the network of one with the other but can't get the 2nd to see the network of the first. Finally, I stumbled upon

  • Paging file

    macbook pro mid 2009 model a1286 bootcamp winxphome sp2 4 gb RAM 2 mb initial size 4008 mb current size 2 mb minimum allowed 4185 mb recommended 2790 mb currently allocated what should i set the virtualmemory / paging file size min/max to? i read on

  • How to replace my iphoto library 08 with version 11 on my external hard drive

    I have my iphoto library version 08 on an external drive. I just downloaded the version 11 onto my internal hard drive. I have moved the version 11 to my external hard drive. How do I merge the 2 versions as the version 11 did not replace the version

  • Copying photos to cd and still having my title and comments

    I am a new i photo user. I am very anal about tagging each photo as to who and where. I used a microsoft product that let me place it directly into the photo. I realize this can not be done in i photo. Which is a shame. But my questions are these. I