Regular Expressions (Pattern/Matcher)

Hi,
I have an regex i.e. *Pattern.compile("([0-9]+)D([0-9]+)'?(?:([0-9]+)\")?([NSEW])").*
It has to exactly match the input e.g *45D15'34"N*
I need to retrieve the values based on grouping.
Group1 = 45 (degree value)
Group2 = 15 (minutes value)
Group3 = 34 (seconds value) ----> this is a non-capturing group
Group4 = N (directions)
The regex works fine for most of longitude/latitude value but I get a StackOverFlow for some. There is a known bug on this [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507]
I was wondering if anyone could suggest a different way of writing the regex above to avoid the stack over flow.
Thank you in advance

cienaP wrote:
Hi,
I have reposted the topic. Thank you for letting me know, this is my first time.You didn't need to create a [new thread|http://forums.sun.com/thread.jspa?threadID=5416548&messageID=10865976#10865976]! You could just have posted a response containing your regex. I shall lock this thread.

Similar Messages

  • Regular Expressions (Pattern/Matcher) --- Help

    Hi,
    I have an regex i.e. Pattern.compile("([0-9])D([0-9])'?(?:([0-9]+)\")?([NSEW])").{code}
    It has to exactly match the input e.g *45D15'34"N*
    I need to retrieve the values based on grouping.
    Group1 = 45 (degree value)
    Group2 = 15 (minutes value)
    Group3 = 34 (seconds value) ----> this is a non-capturing group
    Group4 = N (directions)
    The regex works fine for most of longitude/latitude value but I get a StackOverFlow for some. There is a known bug on this http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507
    According to the bug report, they have said that are many different regex that can trigger the stack overflow....even though the length of my input is not as long as the one posted on the bug report.
    I was wondering if anyone could suggest a different way of writing the regex above to avoid the stack over flow.
    Thank you in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    I missed the '+' in my original regex Pattern.compile("([0-9]+)D([0-9]+)'?(?:([0-9]+)\")?([NSEW])"){code}.
    I have also tried {code} Pattern.compile("(\\d+)D(\\d+)'?(?:(\\d+)\")?([NSEW])");And, the other 2 expressions as suggested by you.
    The problem happens when Durham Lat=”35D52’N” Lon=”78D47’W value is selected from a Jtree(the values are parsed from a xml file to the tree - the xml file has a bout 800 longitude/latitude elements for different cities in the US). It does not happen for other values and If I increment the degree or min by, then the expression works. I am not sure how else i could re-write this exp.
    Below is the snippet of the xml file:
    <State name="NORTH CAROLINA">
                <City name="Asheville AP"     Lat="35D26'N"     Lon="82D32'W"/>
                <City name="Charlotte AP"     Lat="35D13'N"     Lon="80D56'W"/>
                <City name="Durham"     Lat="35D52'N"     Lon="78D47'W"/>
                <City name="Elizabeth City AP"     Lat="36D16'N"     Lon="76D11'W"/>
                <City name="Fayetteville, Pope AFB" Lat="35D10'N"     Lon="79D01'W"/>
                <City name="Goldsboro,Seymour-Johnson"     Lat="35D20'N"     Lon="77D58'W"/>
                <City name="Greensboro AP (S)"     Lat="36D05'N"     Lon="79D57'W"/>
                <City name="Greenville"     Lat="35D37'N"     Lon="77D25'W"/>
                <City name="Henderson"     Lat="36D22'N"     Lon="78D25'W"/>
                <City name="Hickory"     Lat="35D45'N"     Lon="81D23'W"/>
                <City name="Jacksonville"     Lat="34D50'N"     Lon="77D37'W"/>
                <City name="Lumberton"     Lat="34D37'N"     Lon="79D04'W"/>
                <City name="New Bern AP"     Lat="35D05'N"     Lon="77D03'W"/>
                <City name="Raleigh/Durham AP (S)"     Lat="35D52'N"     Lon="78D47'W"/>
                <City name="Rocky Mount"     Lat="35D58'N"     Lon="77D48'W"/>
                <City name="Wilmington AP"     Lat="34D16'N"     Lon="77D55'W"/>
                <City name="Winston-Salem AP"     Lat="36D08'N"     Lon="80D13'W"/>
            </State>
    public final class GeoLine {
        /* Enum for the possible directions of longitude and latitude*/
        public enum Direction {
            N, S, E, W;
            public boolean isLongitude() {
                return (this == E || this == W);
            public boolean isLatitude() {
                return (this == N || this == S);
            public Direction getCanonicalDirection() {
                if (this == S) {
                    return Direction.N;
                } else if (this == W) {
                    return Direction.E;
                } else {
                    return this;
        private final int degree;
        private final int minute;
        private final int second;
        private final Direction dir;
        /* Recognizes longitude and latitude values that has degrees, minutes and seconds i.e. "45D15'34"N
        * or "45D1534"N. The single-quotes for the minutes is optional. And, for the moment we do not support seconds
        * validation although ilog library returns the longitude/latitude with second when NEs and Sub-networks are
        * dragged and dropped on the map.*/
    private static final Pattern PATTERN = Pattern.compile("([0-9]+)D([0-9]+)'?(?:([0-9]+)\")?([NSEW])");
        public GeoLine(int degree, int minute, Direction dir) {
            this(degree, minute, 0, dir);
        public GeoLine(int degree, int minute, int second, Direction dir) {
            Log.logInfo(getClass().getSimpleName(), "PAU degree: " + degree + " minute: " + minute + " second: " + second + " direction: " +  dir);
            verifyLongitudeLatitude(degree, dir);
            verifyMinute(degree, minute, dir);   
            this.degree = degree;
            this.minute = minute;
            this.second = second;
            if (this.degree == 0 && this.minute == 0 && this.second == 0) {
                this.dir = dir.getCanonicalDirection();
            } else {
                this.dir = dir;
        public Direction getDirection() {
            return dir;
        public int getMinute() {
            return minute;
        public int getDegree() {
            return degree;
        public int getSecond() {
            return second;
        public static GeoLine parseLine(String location) {
            * Matcher class will throw java.lang.NullPointerException if a null location
            *  is passed, null location validation is not needed.
            Matcher m = PATTERN.matcher(location);
            if(m.matches()) {
                int deg;
                int min;
                int second;
                Direction direction;
                deg = Integer.parseInt(m.group(1));
                min = Integer.parseInt(m.group(2));
                if (m.group(3) == null) {
                    second = 0;
                } else {
                    second = Integer.parseInt(m.group(3));
                direction = Direction.valueOf(m.group(4));
                return new GeoLine(deg, min, second, direction);
            } else {
                throw new IllegalArgumentException("Invalid location value. Expected format XXDXX'XX\"[NSEW] " + location);
        private void verifyMinute(int deg, int min, Direction direction) {
            /* This validation is to make sure that minute does not exceed 0 if maximum value for latitude == 90
            * or longitude == 180 is specified */
            int maxDeg = direction.isLatitude() ? 90 : 180;
            if(min < 0 || min > 59) {
               throw new NumberFormatException("Minutes is out of range. Value should be less than 60: " + min);
            if (deg == maxDeg && min > 0) {
                throw new NumberFormatException("Degree value " + deg + "D" + direction + " cannot have minute exceeding 0: " + min);
        private void verifyLongitudeLatitude(int valDeg, Direction valDir) {
               int max = valDir.isLatitude() ? 90 : 180;
               if(valDeg < 0 || valDeg > max) {
                    throw new NumberFormatException("Degree " + valDeg + valDir + " is invalid");
        public final boolean isLongitude() {
            return dir.isLongitude();
        public final boolean isLatitude() {
            return dir.isLatitude();
        @Override
        public final String toString(){
            if(minute < 10){
                return degree + "D0" + minute + dir;
            } else {
                return degree + "D" + minute + dir;
        @Override
        public boolean equals(Object obj) {
            if (obj instanceof GeoLine) {
                GeoLine other = (GeoLine) obj;          
                    return (this.degree == other.degree && this.minute == other.minute && this.second == other.second && this.dir == other.dir);
            return false;
        @Override
        public int hashCode() {
            int result = 17;
            result = result * 37 + degree;
            result = result * 37 + minute;
            result = result * 37 + second;
            result = result * 37 + dir.hashCode();
            return result;
    }Thank you again.

  • Regular expression, Pattern.matcher() method

    Pattern.matcher() method start finding a new match from the end of the previous matcher.
    Can Pattern.matcher() method start finding a new match from the second letter of the previous match?
    For example, this piece of code will give a result as :
    find 1 --- 3
    find 4 --- 6
    +++++++++++++++++++++++++++++++++++++++++++++++++++
              Pattern pattern = Pattern.compile("aaa");
              Matcher matcher = pattern.matcher("aaaaaaa");
              while(matcher.find())
                   int from = matcher.start() + 1;
                   int to = matcher.end();
                   System.out.println("find " + from + " --- " + to);
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    How can I change the code so the programme can give a result as:
    find 1 --- 3
    find 2 --- 4
    find 3 --- 5
    find 4 --- 6
    find 5 --- 7
    Thanks very much in advance.

    Check out the API there are Two find methods
    public boolean find() - This method starts at the beginning of the input sequence or, if a previous invocation of the method was successful and the matcher has not since been reset, at the first character not matched by the previous match.
    public boolean find(int start) Resets this matcher and then attempts to find the next subsequence of the input sequence that matches the pattern, starting at the specified index.
    so you could do it something like this:
    int startIndex = 0
    while (matcher.find(startIndex)){
      int from = matcher.start() + 1;
      int to = matcher.end();
      System.out.println("find " + from + " --- " + to);
      startIndex = ?????
    }

  • Regular expressions Pattern Matching

    Test Data
    1. xyz<<<testdata>>>123
    2. zzz<<<test<<<data>>>ssf
    3. sss<<<test<data>>>sffsd
    Expected Result
    1. <<<testdata>>>
    2. <<<data>>>
    2. <<<test<data>>>
    Sql Used:
    select REGEXP_SUBSTR('<<<testdata>>>', '(<<<)([^<<<]*)(>>>)', 1, 1) from dual;
    For 1 and 2 it gives me the proper value as expected, but for third test data its not giving any result.
    Can anyone please help me to get this result??

    how about this then:
    WITH t AS (SELECT 'Vendor <<<Acme Co>>>' col1
                 FROM dual
                UNION
               SELECT 'You PO Number <<<12345>>> has been generated.'
                 FROM dual
                UNION
               SELECT '<<<Wile e cyote>>>'
                 FROM dual
    SELECT t.col1
         , REGEXP_SUBSTR(t.col1, '[^a-zA-Z1-9\s]{3}(([a-zA-Z1-9]|\s)+)[^a-zA-Z1-9\s]{3}') new_col1
      FROM t
    COL1                                          NEW_COL1                                                                                                                                                                           
    <<<Wile e cyote>>>                            <<<Wile e cyote>>>                                                                                                                                                                  
    Vendor <<<Acme Co>>>                          <<<Acme Co>>>                                                                                                                                                                       
    You PO Number <<<12345>>> has been generated. <<<12345>>>                                                                                                                                                                         

  • "Match Regular Expression" and "Match Pattern" vi's behave differently

    Hi,
    I have a simple string matching need and by experimenting found that the "Match Regular Expression" and "Match Pattern" vi's behave somewhat differently. I'd assume that the regular expression inputs on both would behave the same. A difference I've discovered is that the "|" character (the "vertical bar" character, commonly used as an "or" operator) is recognized as such in the Match Regular Expression vi, but not in the Match Pattern vi (where it is taken literally). Furthermore, I cannot find any documentation in Help (on-line or in LabVIEW) about the "|" character usage in regular expressions. Is this documented anywhere?
    For example, suppose I want to match any of the following 4 words: "The" or "quick" or "brown" or "fox". The regular expression "The|quick|brown|fox" (without the quotes) works for the Match Regular Expression vi but not the Match Pattern vi. Below is a picture of the block diagram and the front panel results:
    The Help says that the Match Regular Expression vi performs somewhat slower than the Match Pattern vi, so I started with the latter. But since it doesn't work for me, I'll use the former. But does anyone have any idea of the speed difference? I'd assume it is negligible in such a simple example.
    Thanks!
    Solved!
    Go to Solution.

    Yep-
    You hit a point that's frustrated me a time or two as well (and incidentally, caused some hair-pulling that I can ill afford)
    The hint is in the help file:
    for Match regular expression "The Match Regular Expression function gives you more options for matching
    strings but performs more slowly than the Match Pattern function....Use regular
    expressions in this function to refine searches....
    Characters to Find
    Regular Expression
    VOLTS
    VOLTS
    A plus sign or a minus sign
    [+-]
    A sequence of one or more digits
    [0-9]+
    Zero or more spaces
    \s* or * (that is, a space followed by an asterisk)
    One or more spaces, tabs, new lines, or carriage returns
    [\t \r \n \s]+
    One or more characters other than digits
    [^0-9]+
    The word Level only if it
    appears at the beginning of the string
    ^Level
    The word Volts only if it
    appears at the end of the string
    Volts$
    The longest string within parentheses
    The first string within parentheses but not containing any
    parentheses within it
    \([^()]*\)
    A left bracket
    A right bracket
    cat, cag, cot, cog, dat, dag, dot, and dag
    [cd][ao][tg]
    cat or dog
    cat|dog
    dog, cat
    dog, cat cat dog,cat
    cat cat dog, and so on
    ((cat )*dog)
    One or more of the letter a
    followed by a space and the same number of the letter a, that is, a a, aa aa, aaa aaa, and so
    on
    (a+) \1
    For Match Pattern "This function is similar to the Search and Replace
    Pattern VI. The Match Pattern function gives you fewer options for matching
    strings but performs more quickly than the Match Regular Expression
    function. For example, the Match Pattern function does not support the
    parenthesis or vertical bar (|) characters.
    Characters to Find
    Regular Expression
    VOLTS
    VOLTS
    All uppercase and lowercase versions of volts, that is, VOLTS, Volts, volts, and so on
    [Vv][Oo][Ll][Tt][Ss]
    A space, a plus sign, or a minus sign
    [+-]
    A sequence of one or more digits
    [0-9]+
    Zero or more spaces
    \s* or * (that is, a space followed by an asterisk)
    One or more spaces, tabs, new lines, or carriage returns
    [\t \r \n \s]+
    One or more characters other than digits
    [~0-9]+
    The word Level only if it begins
    at the offset position in the string
    ^Level
    The word Volts only if it
    appears at the end of the string
    Volts$
    The longest string within parentheses
    The longest string within parentheses but not containing any
    parentheses within it
    ([~()]*)
    A left bracket
    A right bracket
    cat, dog, cot, dot, cog, and so on.
    [cd][ao][tg]
    Frustrating- but still managable.
    Jeff

  • Regular Expression for Match Pattern (string) Function

    I need to find a variable length string enclosed by brackets and
    within a string. Can't seem to get the regular expression right for
    the Match Pattern function. I'm able to get the job done using the
    Token function, but it's not as slick or tight as I'd like. Does
    anybody out there have the expression for this?

    Jean-Pierre Drolet wrote in message news:<[email protected]>...
    > The regular expression is "\[[~\]]*\]" which means:
    > look for a bracket "\[" (\ is the escape char)
    > followed by a string not containing a closing bracket "[~\]]*"
    > followed by a closing bracket "\]". The match string include the
    > brackets
    >
    > You can also read "Scan from String" with the following format:
    > "%[^\[]\[%[^\[\]]" and read the 2nd output. The brackets are removed
    > from the scanned string.
    Thanks, Jean_Pierre
    I did some more experimenting after posting and found that \[.*\] also
    works with the match pattern function. Thanks for your input.
    sm

  • Regular Expression for match pattern

    Hi guys, I need some help.
    In one part of my test system, I give to the program a sequence of temperatures, which are numbers separated by a comma. Due to a possible error, the user can  forget the coma, and the program gets unexpected values.
    For example, "20, 70, -10" is a right value, whereas "20 70, -10" would be a wrong one.
    Which regular expression will detect this comma absence?
    Thanx in advance.

    OK, makes it more difficult (and more fun )
    My original version failed also when the space was forgotten.  DOH!
    Try this version.  It get's complicated cause the scan from string likes ignoring spaces... So we change the spaces
    Hope this helps
    Shane.
    PS The ideas given by others are still a better solution, but if you're stuck........
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Check input string with commas(array).vi ‏39 KB

  • Regular expression to match incremental or consecutive digits

    I need to process a string containing all digits to ensure that it does not contain either
    (a) a group of 5 or more consecutive identical digits eg. 11111
    (b) a group of 5 or more incremental/decremental digits eg 12345, 98765
    Also, is there a processing difference between the reluctant and greedy qualifiers?
    Case (a) seems to be easy:
    Pattern pattern = Pattern.compile("[0-9]{5,}?");but what about (b) ? From the documentation it seems that using capturing groups might be helpful, but they are confusing me.
    Finally how do I merge multiple pattern matching strings into one overall regular expression so I can make one pass on the input to see whether it is valid or not?
    Thanks
    Chris

    give this code a try
    public class Test {
         static boolean check(String str) {
              loop : for (int x = 0, y; x < str.length() - 4; x += y) {
                   y = 1;
                     int dif = (str.charAt(x+y) - str.charAt(x)); //assuming you don't whant 90123
                     if (dif >= -1 && dif <= 1) {
                        for (; y < 4; y++) {
                             if ((str.charAt(x+y+1) - str.charAt(x+y)) != dif) {
                                  continue loop;
                        return true;
              return false;
         public static void main(String[] args) {
              System.out.println(check(args[0]));
    }

  • White space in regular expressions (Pattern class)

    Hello,
    I have to check if a String contains ONLY the following characters: a-z, A-Z, ' and ( ) .
    The regular expression that I wanted to use with the Pattern class was [[a-zA-Z][\u0027][\u0028][\u0029][\s]] .
    Now, my compiler (Eclipse) doesnt recognize \s as an expression. Is this the proper expression for a white space?
    Also, in this notation, will the Pattern check for the order of the characters, cause the order isn't supposed to matter.
    I would appreciate any help you could give me on this subject.
    With Best Regards, Roderick

    I'm not a regex expert, but I don't see any of the regex gurus online, and this I can tell you.
    my compiler (Eclipse) doesnt recognize \s as an expressionYou need to escape the backspace in a String literal. Use"\\s"
    in this notation, will the Pattern check for the order of the charactersFor that I think (note:think, not know) you need to put the entire set of characters to be matched in one character class. Could you try this and post back whether it works for your requirement?"[^a-zA-Z'()\\s]"Note the negation operator at the start of the characer class, which will match positive for any character not in the character class.
    db
    edit You can test your regex here:
    {color:0000ff}http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx{color}
    but remember to double the backslashes whe you include it in your java code as a String literal.
    Edited by: Darryl.Burke

  • -Split Regular expression pattern

    Hi all,
    I came across the below example in Lee Holmes' PowerShell Cookbook 3rd editon:
    "Hello World" -split  "He(ll.*o)r(ld)"
    and the output is:
    llo Wold
    Even though I do understand Regular Expressions to some degree (where I can comfortably write a reasonably simple pattern for -replace operator or Select-String cmdlet for example), I am struggling to understand the RE pattern above and what it's trying
    to achieve in the -split context. What are the 2 groupings trying to achieve here while splitting a text? What I want to know is the literal translation of the pattern above in clear English words.
    Any thoughts?

    I guess that explains it clearly now. In fact that's what I wrote above yesterday. So parenthesis in -split operator pattern is not a grouping construct, instead a 'preserving' construct, saving it from consumption by the split operation.
    Therefore, following -match operator pattern-semantics  to understand -split operator will mislead us here.
    But then again, I have troubles understanding the below pattern  
    "Hello World" -split  "(He(ll.*o)r(ld))"Hello World
    llo Wo
    ld
    However, I think I will leave it at this stage. The main thing I wanted to know was what those parenthesis were there for and now I have the answer. It did not really makes sense to group a pattern for -split operator hence I started this thread.
    I think that's all I wanted to know. Thank you.

  • Urgent!!! Problem in regular expression for matching braces

    Hi,
    For the example below, can I write a regular expression to store getting key, value pairs.
    example: ((abc def) (ghi jkl) (a ((b c) (d e))) (mno pqr) (a ((abc def))))
    in the above example
    abc is key & def is value
    ghi is key & jkl is value
    a is key & ((b c) (d e)) is value
    and so on.
    can anybody pls help me in resolving this problem using regular expressions...
    Thanks in advance

    "((key1 value1) (key2 value2) (key3 ((key4 value4)
    (key5 value5))) (key6 value6) (key7 ((key8 value8)
    (key9 value9))))"
    I want to write a regular expression in java to parse
    the above string and store the result in hash table
    as below
    key1 value1
    key2 value2
    key3 ((key4 value4) (key5 value5))
    key4 value4
    key5 value5
    key6 value6
    key7 ((key8 value8) (key9 value9))
    key8 value8
    key9 value9
    please let me know, if it is not possible with
    regular expressions the effective way of solving itYes, it is possible with a recursive regular expression.
    Unfortunately Java does not provide a recursive regular expression construct.
    $_ = "((key1 value1) (key2 value2) (key3 ((key4 value4) (key5 value5))) (key6 value6) (key7 ((key8 value8) (key9 value9))))";
    my $paren;
       $paren = qr/
               [^()]+  # Not parens
             |
               (??{ $paren })  # Another balanced group (not interpolated yet)
        /x;
    my $r = qr/^(.*?)\((\w+?) (\w+?|(??{$paren}))\)\s*(.*?)$/;
    while ($_) {
         match()
    # operates on $_
    sub match {
         my @v;
         @v = m/$r/;
         if (defined $v[3]) {
              $_ = $v[2];
              while (/\(/) {
                   match();
              print "\"",$v[1],"\" \"",$v[2],"\"";
              $_ = $v[0].$v[3];
         else { $_ = ""; }
    C:\usr\schodtt\src\java\forum\n00b\regex>perl recurse.pl
    "key1" "value1"
    "key2" "value2"
    "key4" "value4"
    "key5" "value5"
    "key3" "((key4 value4) (key5 value5))"
    "key6" "value6"
    "key8" "value8"
    "key9" "value9"
    "key7" "((key8 value8) (key9 value9))"
    C:\usr\schodtt\src\java\forum\n00b\regex>

  • How to form a regular expression for matching the xml tag?

    hi i wanted to find the and match the xml tag for that i required to write the regex.
    for exmple i have a string[] str={"<data>abc</data>"};
    i want this string has to be splitted like this <data>, abc and </data>. so that i can read the splitted string value.
    the above is for a small excercise but the tagname and value can be of combination of chars/digits/spl symbols like wise.
    so please help me to write the regular expression for the above requirement

    your suggestion is most appreciable if u can give the startup like how to do this. which parser is to be used and stuff like that

  • Regular expressions for matching file path

    Could someone give me idea that how can i compare a fixed path, with the paths user gives using regular expressions?
    My fixed path is : src\com\sample\demo\work\gui\.**
    and user may give like src\com\sample\demo\work\gui\test.jsp, src\com\sample\demo\work\gui\init.jsp etc.
    Any ideas are appreciated and thanks in advance.

    ...and if you insist on using regexes, you'll have to double-escape the backslashes: if ( userString.matches("src\\\\com\\\\sample\\\\demo\\\\work\\\\gui\\\\.*") ) { Whether you use regexes or not, you'll save yourself a lot of hassle by converting all backslashes to forward slashes before you do anything with the strings: userString = userString.replace('\\', '/');
    if ( userString.matches("src/com/sample/demo/work/gui/.*") ) {
    // or...
    if ( userString.startsWith("src/com/sample/demo/work/gui/") ) {

  • Regular Expression Pattern

    I currently have a RegExp pattern set up with the expression (\w\s\!\$/\(\)\&\.\+\-]+) (there is a [ between the ( and \w but it was showing HTML: instead of [ (maybe the problem?)) but when I try to compile the page, I get an XML-20201: (Fatal Error) Expected name instead of \ error
    Does anybody have any idea what I need to change in the regular expression to get it to run in Jdeveloper?
    Thanks
    Andy

    <messageTextInput id="${bindings.ItemCodesCodeDescription.path}" model="${bindings.ItemCodesCodeDescription}" required="yes" readOnly="${jhsUserRoles['ITEMS_RO']}" promptAndAccessKey ="Des&amp;cription" rows="1" maximumLength="50" columns="30">
    <onSubmitValidater>
    <regExp pattern="(\w\s\!\$/\(\)\&\.\+\-]+)"/> //again, [ between ( and \w
    </onSubmitValidater>
    </messageTextInput>
    It's part of a Description textInput, we want to limit the use of characters because it will be saved to our database

  • Regular expressions Pattern

    Hi
    I have to check for for some files in a file system if all the required files exists then next logic continues
    for ex: String pattern = "Hello(A|B|C|D|E|F|G).txt";
    for (int i =0; i < children.length; i++)
    if (Pattern.matches(pattern,children))
    set.add(children[i]);
    above code sets the elements to set if they exists but does't check if some file is missing.
    How do i check my condition for all matches, if not its should exit.
    any help whould be appreciated

    I think this is essentially the same as his other question.
    http://forum.java.sun.com/thread.jspa?threadID=709248

Maybe you are looking for

  • How do I set up multiple midi-input devices:WX5 wind & keyboard controllers

    Hello, I'm trying to setup my system to utilize two midi input devices. 1. Novation Controller Keyboard connected through USB 2. WX5 wind controller connected via VL-70 tone module with midi out cable to channel 1 of my Motu midi interface. As it is

  • 30P to 24P audio problem

    Hi all, quick question that I cannot ind an answer to: I shot at 30, and I want to slow it down to 24 for a slight slow mo look, I right click the file in PP, interpret footage-23.98 then try playing it in the source monitor, it looks and sounds grea

  • ItemRenderer overides the DataGrid styles

    Hi, I have a CSS file where I have defined the styles for DataGrid like following: DataGrid       selection-color: #243E4F;       text-selected-color: #FFFFFF;       alternating-item-colors: #DCE3E8, #FFFFFF; I have a Datagrid in my mxml component pa

  • Should I seek a 3rd party for color/contrast?

    I installed Mountain Lion a couple months ago. Although there are a few feature I really like, Apple took away a lot of real basic stuff away for no apparent reason. One change in Mountain Lion is the lack of color in icons (like in the Mail SideBar,

  • Help Searching GPO XML

    Good afternoon- I'm trying to search all of the GPOs in my environment for "NT AUTHORITY\Authenticated Users" in any User Rights Assignment section. We need to implement a forest-wide authentication trust and need to know where "Authenticated Users"