Reg expression help

Can/will you help me make a regular expression for these characters? I want to replace eveyone occurance in a string contianing these chars
\/:*"<>|
with
right now I am doing a string.replaceAll(...) on each char but I was wanting to combine that to one reg expression. What cha got? I am doing this b/c I am generating file names and those are not valid chars allowed in file names.
Thanks
Doopterus

  String regex = "[*<>/'\"\\\\]";In a character class (i.e., between the square brackets), "|" has no special meaning.

Similar Messages

  • CFINPUT Reg Expression Validation Pattern Help

    I've got a form with a non-required field that needs to meet
    some validation requirements (Numbers, Letters, 'space character'
    or 'blank, empty string' only) if the user chooses to fill it
    out...
    I'm using CFINPUT tag with the following settings, does my
    Reg Expression pattern look OK?
    REQUIRED="No"
    VALIDATE="regular_expression"
    PATTERN="^[a-zA-Z *]{1,40}$"
    MAXLENGTH="40"
    Thanks for any help. I'm v. new to regular expressions (10
    hrs education at Google Univ.)
    Sincerely,
    Paul Cross

    I think you want something more like this:
    ^[a-zA-Z0-9 ]{0,40}$

  • Reg exp help

    Hi
    I want to extract the first token of filename (and not the directory path) from a string like this:
    D:\MIRACLE\UPLOADS\1361\HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62
    HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62
    \HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62
    /HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62
    the tokens would bed HG-ORA02 in all instances
    Could you help me creating a reg expression to get the token?
    best regards
    Mette

    Hi,
    Whenever you have a problem, it helps if you post your sample data in a form people can use.
    CREATE TABLE and INSERT statements are great; so is:
    CREATE TABLE     table_x
    AS          select 'D:\MIRACLE\UPLOADS\1361\HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 1 as x_id FROM dual
    UNION ALL     SELECT 'HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 2 as x_id FROM dual
    UNION ALL     SELECT '\HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 3 as x_id FROM dual
    UNION ALL     SELECT '/HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 4 as x_id FROM dual
    ;It also helps if you explain how you get the results you want from that data.
    Assuming that
    (a) the filename is divided, first, by '/' or '\' characters, and
    (b) each of those parts may be divided into tokens by '.' or '#' characters, and that
    (c) we want the first (b) part of the last (a) part:
    SELECT     REGEXP_SUBSTR ( REGEXP_SUBSTR ( filename
                              , '[^/\]*$'
                    , '[^.#]+'
                    ) AS token_1
    FROM     table_x;Here, the inner REGEXP_SUBSTR finds the last part delimited by / or \. You can add other delimiters by putting them in the square brakets, anywhere after ^.
    The outer REGEXP_SUBSTR operates on the results of the inner one. It returns the first part delimited by . or #. Again, you can add other delimiters.

  • Will an Airport Express help with the signal I am not receiving on my Smart TV?

    Will the Express help with internet issue's I have with my new Smart TV?

    If you already have another Apple AirPort router that is providing your wireless signal, then a new AirPort Express could extend that wireless signal to provide a stronger wireless signal to the TV....assuming that the TV connects using wireless.
    Is this what you are asking?
    Or, would the Express provide other services to "help"?

  • Validate through Reg Expression

    Hi,
    I have following requirement to be achieved through reg expressions.
    Need to write a boolean method which takes a String parameter that should satisfy following conditions.
    o 20 character length string.
    o First 9 characters will be a number
    o Next 2 characters will be alphabets
    o Next 2 characters will be a number.(1 to 31 or 99)
    o Next 1 character will be an alphabet
    o Last 6 characters will be a number.
    JDev 11.1.1.6.0

    Hi,
    Hope following links are useful
    https://blogs.oracle.com/shay/entry/regular_expression_validation
    http://www.vogella.com/articles/JavaRegularExpressions/article.html

  • My ipad 2 and ipod touch keeps on dropping wifi connection,  would getting an apple router or maybe airport express help?

    ipad 2 and ipod touch  keeps on dropping wifi, would upgrading to an apple router/airport express help?  all my other pc's work well with my current network.

    Have you checked for a firmware update for your current router?
    What make, model, version router do you have?

  • Help with Reg Expression Start method

    Hi there,
    I've been looking through some examples of regular expressions and I've became totally unglued at what the start method of the Matcher class returns.
    Here's the example...
    Passing in "\d*" ab34ef to the following code
    import java.util.regex.*;
    public class Class1
      public static void main(String []args)
        Pattern p= Pattern.compile(args[0]);
        Matcher m=p.matcher(args[1]);
        boolean b=false;
        while (b=m.find())
          int x=m.start();
          String y=m.group();
          System.out.print(x + y);
    }Gives the output
    01234456
    I understand eveything apart from the 6 character. How can m.start()return 0 (at the start) and 6 at the end when the string being searched is 6 characters long.
    My head hurts.

    The fact that a string is an array of characters under the hood is just an implementation detail, and it's getting in your way. What start() returns is the beginning position of a substring which may have a length of zero.
    The first time through the loop, the regex matches a zero-length substring at the beginning of the target string. That's the position preceding the first character, index 0. Then, because the match didn't consume any characters, the Matcher moves ahead one position before trying again. Another zero-length match, another bump-along, and now it's at index 2. This time, the regex can actually match some characters. It matches the substring "34", and that brings us to the part that's really confusing. Because the previous match consumed some characters, the Matcher doesn't do a bump-along before attempting the next match. It matches a zero-length substring at index 4, right where the previous match ended. Then it bumps along to index five and does another zero-length match.
    Now, you and I know that the character at index 5 is the last one in a string whose length is 6, so there's no reason to look for any more matches at this point. And if the regex were required to match at least one character, the Matcher wouldn't bother trying again. But in this case a zero-length match is considered valid, and there's one more position where that's possible. It does one last bump-along and matches nothing once more.

  • Regular Expression Help

    I need help writting a regular expression that will match the following strings:
    1+1,1+(1+1),((1+1)+(1+1)),1+(1+(1+1)). Basically one that will match an arithmetic expression (operands limited to 1's and operators to '+' sign) with or without correctly matched parentheses. Have'nt had much luck so far. Any input will help. thanks

    okay, you asked for it:
    [1+()]+
    it will only match those string but it will tell you nothing about syntactically correct expressions. This is because these types of expression are not "regular" and cannot be properly parsed using regular expressions.

  • EXPRESSION help,layer markers

    Hi
    I've got a comp with one camera and 100 3d layers distributed randomly in 3 space.Each layer has got a different z-Rotation value.
    The camera animates from one layer to the other via script (the script generates
    automatically layer markers and keyframes for each animation).So,there are 101 layer markers.
    Example:
    The camera moves between layer marker 2+3 from layer 2 to 3 for example.
    Layer 2 has got a z-rotation value of -14° and layer 3=>45°.
    basically,i need a camera (z orientation) expression so the camera animates
    from -14° to 45° between these two layer markers and so on.
    THX

    Yeah, what part of the equation do you not understand? The first part simply checks whether markers exist at all, then counts them down until there are none left after a given time. If you want to blend between the different values, you'd simply need to plug the marker times into the remapping. Something like this:
    markNow=marker.nearestKey(time).index;
    markNext=marker.nearestKey(time).index+1;
    timeNow=marker(markNow).time;
    timeNext=marker(markNext).time;
    rotationNow=thisLayer.transform.zRotation.valueAtTime(timeNow);
    rotationNext=thisComp.layer(index+1).transform.zRotation.valueAtTime(timeNow);
    rotationFinal=linear(time,timeNow.timeNext,rotationNow,rotationNext)
    You only need to include this in the curly braces or return n outside the function to make use of this. Haven't tested it, as I'm not in front of AE, but on an abstract level this is how it should work. Hope it helps to get yoou started.
    Mylenium

  • Expression help with time remapping

    Hi
    I have a 25fps Precomp with an animation that changes on every frame.
    In the master comp I want to apply an expression to its time remap property so that it holds on each consecutive frame for a given duration, eg on Frame 1-15 we see frame 1 of precomp, on frame 16-30 we see frame 2, and so on.  I can't figure this out. Tried posterizeTime and some other bits to no avail and can't find it elsewhere on the web.
    Thanks, Steve

    <Big sigh of relief> Thank-you Dan.
    I read your expressions everywhere on the web and when I need a little help you are there within MINUTES!
    You are such an asset to the AE community.

  • Expression help needed - control speed of a pan via a slider

    I've done this in the past but can't locate my old project, and my head is throbbing from last nite.....
    I'd like to apply an expression to my null's position. I want it to pan horizontally at a speed specified with a slider control. I'd like it to be able to start, stop, and then continue. Doesn't need to ease in, but it'd be nice.
    Speed = effect("Speed")("Slider");
    OffsetX = effect("Offset")("Point")[0];
    fps = 24;
    x = OffsetX - (Speed * time * fps);
    [x,243]
    My problem multiplying "speed" with time means that when it stops (speed=0), it returns to the start position.... I need it to stay in place, and then continue when I animate the speed value back up.
    Please help my hungover brain....

    Here's a quick and dirty method:
    >v = effect("Velocity")("Point");
    vSum = 0;
    for(t = 0; t <= time; t+=thisComp.frameDuration) vSum += v.valueAtTime(t);
    value+vSum*thisComp.frameDuration
    Unfortunately, it is pretty slow to calculate, and just gets slower the further you go down the timeline. Also, it doesn't actually produce continuous motion, so it doesn't play well with motion blur.
    I'm working on a much more efficient expression that does work with motion blur, but I can't seem to get it to behave once you get past the last keyframe. If I have a breakthrough, I'll post it.

  • Expression Help.  'Every 3 frames move right 1 pixel'?

    Hello,
    Im trying to solve an issue i am having with aliasing on sliding text.
    I would like to drop an expression on my text layer (bitpmap).
    ie, i want to slide the text 30 pixels over 90 frames.
    If i do that using simple keyframes, the text blurs a bit when not on an whole number frame( 30.3)
    Is there an expression i can use so that the text is moved one whole pixel, but not until 3 frames has passed?
    Thanks very much for any help!
    QMP

    X=Math.floor(timeToFrames(time)/3);
    Y=position[1];
    [X,Y]
    Mylenium

  • Expression help. Opacity using a null slider

    Hi,
    I'm using the expression below on a few layers in order to achieve a 'rolodex' look. The expression was applied to the x axis of the layers.
    numCards=thisComp.layer("Null 1").effect("numCards")("Slider");
    viewCard=thisComp.layer("Null 1").effect("viewCard")("Slider");
    v=((index-1) * (360/numCards) + viewCard*(360/numCards))%360;
    if (v<10) {
    ease(v,0,10,-20,120);
    } else {
    linear(v,10,360,120,340);
    I would like to make it so that I can control the opacity of the given layer so that lets say when the 'card' (layer) in question is at a certain point in its cylce the opacity will go from 0 to 100 and then fade back down to zero.
    This expression was taken from somewhere else, and I'm learning them (but slowly).
    Thanks a lot for your help!
    Luke

    Just copy&paste the expression, then substitute the values in the ease() and linear() functions to fall within sensible ranges for opacity. The code is pretty unsafe and unelegant, though. if I were to do it, I'd create completely different one...
    Mylenium

  • Column Visibility Expression help - SSRS

    I have a report in SSRS that has 12 columns. On each column, I have a corresponding column visibility expression like so:
     =IIF(InStr(JOIN(Parameters!HideColumns.Value,
    ","),"01")=0, False, True)
    Where I have the "01" I change to "02","03","04","05","06","07","08","09","10","11"
    & "12" respectfully across my column. The intent is to pass a parameter and allow the end user to "Hide" the column from visibility to allow them the flexibility on printing records. The issue I am having is I need a default that allows
    them to not hide anything, meaning print all 12 columns. Right now, its forcing me to pick one column to hide, is there something I could add to this to say, All? Hope this makes sense.

    Hi,
    For default value of this parameter(Parameters!HideColumns.Value)
    add  a value that is not in 01 to 12 .
    As an example if you  add 13 to the  default value   of the parameter, than  your expression will not hide the column 
       =IIF(InStr("13",
    ","),"01")=0, False, True) 
       =IIF(InStr("13",
    ","),"02")=0, False, True)  and so on.
    Many Thanks
    Chandra
    Please mark the post has answered if this post helps to solve your issue

  • SSRS colour series expression help

    Hi, I have created a graph in SSRS which measures the number of appointments booked against a target.
    The expression for the appointments series is:
    =Switch(Fields!DateCol.Value <= Today(),RunningValue(Count(Switch(Fields!SubCategory.Value = "Booked Appointment - System",Fields!NoteId.Value)), SUM, Nothing))
    And the target is simply:
    =RunningValue(Avg(Fields!Target.Value), Sum, Nothing)
    I have coloured the target line in black but I was wondering if it is possible for my appointment series line to be green if above target and red if below target?
    I've never tried this before so any help would be much appreciated!
    Thanks.

    Hi SRidgley,
    Could you please try to provide more details information according to the questions below to help us better understand about your requirements:
    What is the chart type you are currenttly using?
    If possible, please try to provide the snapshot of the chart in the view mode
    Could you please also provide some details information about which field you put in the "Values","Category Group" and "Series Group" and if possible, please provide sample data for me to test.
    I assumed that you have the similar requirements as in the thread below, please take reference:
    https://social.technet.microsoft.com/Forums/en-US/4310fd02-ef84-4874-b11e-993ff2943f6f/how-to-display-the-actual-reading-alone-the-dot-and-conditional-change-the-color-of-the-dotfigure?forum=sqlreportingservices
    If you still have any problem, pelase feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

Maybe you are looking for