An additional question about regular expressions with String.matches

does the String.matches() method match expressions when some substring of the String matches, or does it have to match the entire String? So, if i have the String "123ABC", and i ask to match "1 or more letters" will it fail because there are non-letters in the String, but then pass if i add "1 or more letters AND 1 or more digits"? so, in the latter every character in the String is accounted for in the search, as opposed to the first. Is that correct, or are there ways to JUST match some substring in the String instead of the whole thing? i WILL make some examples too... but does that make sense?

It has to match the whole String. Use Matcher.find() to match on just a sub-string()

Similar Messages

  • Regular expressions and string matching

    Hi everyone,
    Here is my problem, I have a partially decrypted piece string which would appear something like.
    Partially deycrpted:     the?anage??esideshe?e
    Plain text:          themanagerresideshere
    So you can see that there are a few letter missing from the decryped text. What I am trying to do it insert spaces into the string so that I get:
                        The ?anage? ?esides he?e
    I have a method which splits up the string in substrings of varying lengths and then compares the substring with a word from a dictionary (implemented as an arraylist) and then inserts a space.
    The problem is that my function does not find the words in the dictionary because my string is only partially decryped.
         Eg:     ?anage? is not stored in the dictionary, but the word �manager� is.
    So my question is, is there a way to build a regular expression which would match the partially decrypted text with a word from a dictionary (ie - ?anage? is recognised and �manager� from the dictionary).

    I wrote the following method in order to test the matching using . in my regular expression.
    public void getWords(int y)
    int x = 0;
    for(y=y; y < buff.length(); y++){
    String strToCompare = buff.substring(x,y); //where buff holds the partially decrypted text
    x++;
    Pattern p = Pattern.compile(strToCompare);
    for(int z = 0; z < dict.size(); z++){
    String str = (String) dict.get(z); //where dict hold all the words in the dictionary
    Matcher m = p.matcher(str);
    if(m.matches()){
    System.out.println(str);
    System.out.println(strToCompare);
    // System.out.println(buff);
    If I run the method where my parameter = 12, I am given the following output.
    aestheticism
    aestheti.is.
    demographics
    de.o.ra.....
    Which suggests that the method is working correctly.
    However, after running for a short time, the method cuts and gives me the error:
    PatternSyntaxException:
    Null(in java.util.regex.Pattern).
    Does anyone know why this would occur?

  • One question about Regular Expression!!!

    I need to creat such a regular expression to match the format "[ ][ ][ ]".
    For example, there is a context,
    (1), " The project manager defines [1][0.400][+goals] for iterations."
    Suppose that there are some spaces or "\n" characters in this way,
    (2), " The project manager defines [    1 ] [  0.400   ]
    [   +goals] for iterations."
    If the pattern match the format succefully, (2) strings should be replaced by (1)strings, in order words, the format of (1) is what I need finally,
    I had ever tried creating a regular expression likes \\[([^\n\s]]+)\\]\\[([^\n\s]]+)\\]\\[([^\n\s]]+)\\] , but it does not work well!
    DO YOU HOW TO IMPLEMENT IT IN JAVA?
    Thanks for your any reply!

    What I really need is that, via the regular
    expression, all the spaces and \n characters in
    square brackets [ and ], ] and [, will be thrown
    away.
    For example,
    Original:
    1) "The project manager defines [   1  ] [
    0.400 ]
    [   +goals] for iterations with the support"
    After matching:
    2) "The project manager defines [1][0.400][ [+goals]
    for iterations with the support"
    String 2) is what I need finally!
    Thanks for your any reply!Well I gave you the answer to that one already :-)
    If you need to preserve the spaces in between words use this one. I'm sure there's a better way to do it, I'm no RegEx master.
        public static void main(String[] args)
            String s = "[ 1 ] [ 0.400 ]\n[ +go als]";
            System.out.println( "Before: " + s );
            System.out.println( "\n\n" );
            s = s.replaceAll( "\\[\\s+", "[" );
            s = s.replaceAll( "\\s+\\]", "]" );
            s = s.replaceAll( "\\]\\s+\\[", "][" );
            System.out.println( "After: " + s );
        }

  • Basic question about regular expressions

    Hello,
    I am a beginner to regular expressions. I want to rewrite the following expression:
    public static final String REGULAR_EXP_SOFTWARE_PART_NUMBER = "([0-9]{7}[a-z]{1})(\\-{1})([a-z]{1})";I want THIS match
    (\\-{1})to occur EITHER if a hyphen is encountered OR if a space is encountered (instead of just the hyphen).
    How do I rewrite this?
    Thanks in advance,
    Julien.

    Hello and thanks for your feedback,
    I have created a small class as follows:
    package regExpr;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    * @author Martin
    public class RegExprTest {
         private static String stringToBeParsed = "3800157w-e26";
         public static void main(String[] args) {
              Pattern pattern = Pattern.compile("" +
                        "([0-9]{7})" +
                        "([a-z]{1})" +
                        "(( |-){1})" +
                        "([a-z]{1})" +
                        "([0-9]{2})" +
              Matcher matcher = pattern.matcher(stringToBeParsed);
              while(matcher.find()){
                   System.out.println(matcher.group(1));
                   System.out.println(matcher.group(2));
                   System.out.println(matcher.group(3));
                   System.out.println(matcher.group(4));
                   System.out.println(matcher.group(5));
                   System.out.println(matcher.group(6));
    }the class is trying tobreak down the following string "3800157w-e26" as follows:
    3800157(seven digits)
    w(one letter)
    -(hyphen)
    e(one letter)
    26(two digits)
    Oddly enough the output of the class is as follows:
    3800157
    w
    e
    26
    I have to call the group method six times and I get two hyphens!
    Can anyone help?
    Thanks in advance,
    Julien

  • Simple question about regular expressions

    Hi,
    Using Java's regular expression syntax, what is the correct pattern string to detect strings like the following :-
    AnnnnnA
    where A = a single (fixed) alphabetic character and
    n = at least one but possibly many digits [0-9].
    Example strings to be searched :-
    A45A (this should match)
    A3A (this should match)
    A3446655577A (this should match)
    A hello world A (this should NOT match as no digits are present between the A's).
    Thanks.

    A least one digit "A.*\\d.*A"
    Only digits "A\\d+A"

  • Beginner question about Regular expression

    Hi all !
    I'd like to use a regular expression to parse a string like this:
    *<ID>4</ID><GROUP>5</GROUP>....*
    So for example to retrieve the ID I have built the following regular expression:
    Pattern p = Pattern.compile("<ID>(.*?)</ID>");  
    Matcher m = p.matcher(handle);    
    if (m.find()) {
          System.out.println("->"+m.group());     
    } else {
    System.out.println("No match!");   
    }The function m.group returns "<ID>4</ID>" but I want just the value (4) between the tag. Is there
    a way to get it ?
    thanks a lot
    mark

    fmarchioniscreen wrote:
    thank you very much, that's exactly what I needed.
    But it looks like you're parsing some XML like data: probably better to use a proper parser on it. Well it's a very short string containing XML tags. it's used in a marginal area of the application so I prefer just using a regular expression to fetch the values
    thanks again
    MarkYou could use XPath to get the value.

  • Question about Regular Expressions, please help!

    I have created an app which reads files and extracts certain data using regular expressions in JDK1.4 using Pattern and Matcher classes.
    However it needs to run on JDK1.2.2 (dont ask). The regular expression classes are not available in 1.2.2 (the Pattern and Matcher class) so i am looking for something similiar which i can use?
    I need something that loops through all the matches found in the file like how Matcher works i.e.
    while (matcher.find())
    // do this
    Help!

    http://jakarta.apache.org/regexp/

  • Simple question about regular expression

    Hi
    I have a little problem with
    select regexp_substr('123 Mapla Avenue','[a-z]') my_test from dual;
    answer: M
    I excecute this query in SQLPlus and SQL Developer result is this same.
    select regexp_substr('123 Mapla Avenue','[M]') my_test from dual;
    answer: M
    select regexp_substr('123 Mapla Avenue','[a]') my_test from dual;
    answer: a
    I used oracle 10g
    Thanks for your help

    hm wrote:
    In the oracle documentation of regexp_substr you can find:Do not confuse pattern and sort. Pattern [a-z] means any lowercase letter. REGEXP_SUBSTR parameter match_param value i tells REGEXP to treat uppercase letters same as lowercase letters and vice versa. And setting NLS_SORT can do the same. As you can see it is not that straight-forward. To make it transparent use exact pattern you need. In this particular case use:
    select regexp_substr('123 Mapla Avenue','[[:alpha:]]') my_test from dual;where class [:alpha:] is POSIX predefined class of all letters (regardless of case). This way you are not dependent of client side settings like NLS_SORT and the above will always return first letter within a string. If you want first uppercase letter use:
    select regexp_substr('123 Mapla Avenue','[[:upper:]]') my_test from dual;Or, for first lowercase letter:
    SQL> alter session set nls_sort=binary;
    Session altered.
    SQL> select regexp_substr('123 Mapla Avenue','[a-z]') my_test from dual;
    M
    a
    SQL> select regexp_substr('123 Mapla Avenue','[[:lower:]]') my_test from dual;
    M
    a
    SQL> alter session set nls_sort=binary_ci;
    Session altered.
    SQL> select regexp_substr('123 Mapla Avenue','[a-z]') my_test from dual;
    M
    M
    SQL> select regexp_substr('123 Mapla Avenue','[[:lower:]]') my_test from dual;
    M
    a
    SQL> SY.

  • Question about Regular Expressions

    Hi averyone!
    Could any one help me to create RegEx for string: <object>
    Thanks!
    Kind Regards, Dmitry.

    "<object>"

  • Off Topic: Books about Regular Expression

    Hi
    Somebody can to indicate books about Regular Expression in Oracle ?
    Thanks

    Regex tag of Blog of Volder.
    http://volder-notes.blogspot.com/search/label/Regular%20Expressions
    This entry mentions my regex solution :-)
    http://volder-notes.blogspot.com/2007/10/removing-duplicate-elements-from-string.html
    By the way
    My regex homepage mentions regex problems of perl like regex (regex of EmEditor).
    http://www.geocities.jp/oraclesqlpuzzle/regex/
    example questions (written by Japanese language)
    http://www.geocities.jp/oraclesqlpuzzle/regex/regex-2-1.html
    http://www.geocities.jp/oraclesqlpuzzle/regex/regex-3-5.html
    http://www.geocities.jp/oraclesqlpuzzle/regex/regex-4-4.html

  • Wat should be the regular expression for string MT940_UB_*.txt to be used in SFTP sender channel in PI 7.31 ??

    Hi All,
    What should be the regular expression for string MT940_UB_*.txt and MT940_MB_*.txt to be used as filename inSFTP sender channel in PI 7.31 ??
    If any one has any idea on this please let me know.
    Thanks
    Neha

    Hi All,
    None of the file names suggested is working.
    I have tried using - MT940_MB_*\.txt , MT940_MB_*.*txt , MT940*.txt
    None of them is able to pick this filename - MT940_MB_20142204060823_1.txt
    Currently I am using generic regular expression which picks all .txt files. - ([^\s]+(\.(txt))$)
    Let me know ur suggestion on this.
    Thanks
    Neha Verma

  • Regular Expressions and String

    How do I return a String array as follow using regular expression.
    String[] strArray = {"Now is the time", "you can optionally preview your post","message by using a number of special tokens."}
    from this string
    <separator>Now is the time</separator><separator>you can optionally preview your post</separator><separator>message by using a number of special tokens.</separator>
    Note: The string has the <separator> XML tag

    How do I return a String array as follow using regular
    expression.
    String[] strArray = {"Now is the time", "you can
    optionally preview your post","message by using a
    number of special tokens."}
    from this string
    <separator>Now is the time</separator><separator>you
    can optionally preview your
    post</separator><separator>message by using a number
    of special tokens.</separator>
    Note: The string has the <separator> XML tag
    This cannot be done using simple regular expressions - at least not if your number of <separator>s is random, which is what you seem to imply.
    Simple regular expressions are one-off, that means it can have a String array as a result, but only to the amount of brackets in the regex.
    a regex like:
    <separator>([^<]*)</separator><separator>([^<]*)</separator><separator>([^<]*)</separator>
    would return what you want, but I doubt that it is as flexible as you want it to be.

  • Regular expression with delimited string

    Hi,
    I'm trying extract all characters in a string (as word or words) which is delimited by ' -- '
    Been playing around with regular expression and got as far as this;
    with t_vw
    as (select 'hello -- world' txt from dual
    union all
    select 'hello-world' from dual
    union all
    select 'hello' from dual
    union all
    select 'hello -- world -- bye' from dual
    union all
    select 'hello--worldbye' from dual
    select txt, regexp_substr(txt,'[^ -- ]+',1,1) word1,
    regexp_substr(txt,'[^ -- ]+',1,2) word2,
    regexp_substr(txt,'[^ -- ]+',1,3) word3
    from t_vw;
    It's returning;
    "TXT","WORD1","WORD2","WORD3"
    "hello -- world" "hello","world",""
    "hello-world"          "hello","world",""
    "hello"               "hello","",""
    "hello -- world -- bye"     "hello","world","bye"
    "hello--worldbye"      "hello","worldbye",""
    So it seems to work in all cases apart from when there are no spaces before/after "--".
    Any ideas?

    Please enclose your code in *{noformat}{noformat}* tags to preserve your formatting and to prevent the forum software from mangling your regular expressions.
    Also, you've given your input and show the output that you are getting, but I don't know what your issue is.  If you could include the desired output and explain how it differs from what you are getting so far that would help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Regular Expressions with Unicode Strings - length restriction?

    Hi,
    I can't quite figure this one out. I am checking a String for the presence of a URL.. more specifically, a jpg or gif URL.
    Anyway, the following reg exp will work fine for me. However, when testing with unicode data (chinese text) the expression will only work up to a certain string length. Here's an example:
    boolean isURL = text.matches(".*http\\S*(jpg|gif).*");
    My thought is that since Unicode data takes up more space, there a limitation to dealing with Strings. Does anyone know what that number is? Or, is there another reason the reg exp fails??
    thanks,
    joe
    Example::
    This works for any length String I throw at it using standard ASCII text.. But a unicode string of a certain length won't recognize the URL (I doubt I can simply paste my example here and have it turn out correctly..)
    DOESN'T WORK: (length is reported via text.length() as 344
    "FWD: test_tancy: FWD: tancy: FWD: supporter:
    &#27973;&#28129;&#33394;&#24425;&#36896;&#28165;&#20937;
    &#35201;&#35753;&#23621;&#25152;&#30475;&#36215;&#26469;&#28165;&#29245;&#20937;&#24555;&#65292;&#21487;&#37319;&#29992;&#20197;&#30333;&#33394;&#20026;&#20027;&#35843;&#30340;&#24067;&#32622;&#12290;&#30333;&#33394;&#19981;&#20294;&#33021;&#22686;&#21152;&#31354;&#38388;&#24863;&#65292;&#36824;&#33021;&#33829;&#36896;&#26126;&#24555;&#23425;&#38745;&#30340;&#27668;&#27675;&#65292;&#35753;&#20154;&#24773;&#32490;&#31283;&#23450;&#12290;&#21478;&#22806;&#65292;&#26377;&#24847;&#35782;&#22320;&#22686;&#28155;&#19968;&#28857;&#20919;&#33394;&#65292;&#20063;&#33021;&#20196;&#20154;&#22312;&#35270;&#35273;&#19978;&#35273;&#24471;&#30021;&#24555;&#12290;&#19981;&#36807;&#65292;&#19968;&#38388;&#25151;&#20869;&#33509;&#20840;&#37096;&#20351;&#29992;&#20919;&#33394;&#65292;&#25110;&#20840;&#37096;&#37319;&#29992;&#26262;&#33394;&#65292;&#20250;&#20351;&#20154;&#24863;&#21040;&#19981;&#23433;&#12290;&#26368;&#22909;&#26159;&#30830;&#23450;&#20027;&#33394;&#21518;&#65292;&#23567;&#38754;&#31215;&#20351;&#29992;&#20123;&#21576;&#40092;&#26126;&#23545;&#27604;&#30340;&#33394;&#24425;&#12290;&#20837;&#22799;&#36141;&#32622;&#19968;&#20123;&#33394;&#35843;&#28165;&#20937;&#30340;&#39280;&#29289;&#25670;&#35774;&#65292;&#26159;&#26368;&#30465;&#38065;&#26377;&#25928;&#30340;&#19968;&#25307;&#65292;&#22914;&#20026;&#21488;&#28783;&#25442;&#20010;&#30333;&#33394;&#28783;&#32617;&#12289;&#22312;&#27927;&#25163;&#38388;&#25918;&#19968;&#22871;&#20912;&#34013;&#33394;&#30340;&#27792;&#28020;&#29992;&#20855;&#31561;&#12290;(UU&#20026;&#24744;&#25552;&#20379;&#29983;&#27963;&#21672;&#35759;&#24182;&#31069;&#24744;&#29983;&#27963;&#24841;&#24555;&#65281;&#22914;&#19981;&#24076;&#26395;&#25171;&#25200;&#35831;&#22238;&#22797;?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg"
    WORKS: (length is reported via text.length() as 296
    "FWD: Joe: &#35201;&#35753;&#23621;&#25152;&#30475;&#36215;&#26469;&#28165;&#29245;&#20937;&#24555;&#65292;&#21487;&#37319;&#29992;&#20197;&#30333;&#33394;&#20026;&#20027;&#35843;&#30340;&#24067;&#32622;&#12290;&#30333;&#33394;&#19981;&#20294;&#33021;&#22686;&#21152;&#31354;&#38388;&#24863;&#65292;&#36824;&#33021;&#33829;&#36896;&#26126;&#24555;&#23425;&#38745;&#30340;&#27668;&#27675;&#65292;&#35753;&#20154;&#24773;&#32490;&#31283;&#23450;&#12290;&#21478;&#22806;&#65292;&#26377;&#24847;&#35782;&#22320;&#22686;&#28155;&#19968;&#28857;&#20919;&#33394;&#65292;&#20063;&#33021;&#20196;&#20154;&#22312;&#35270;&#35273;&#19978;&#35273;&#24471;&#30021;&#24555;&#12290;&#19981;&#36807;&#65292;&#19968;&#38388;&#25151;&#20869;&#33509;&#20840;&#37096;&#20351;&#29992;&#20919;&#33394;&#65292;&#25110;&#20840;&#37096;&#37319;&#29992;&#26262;&#33394;&#65292;&#20250;&#20351;&#20154;&#24863;&#21040;&#19981;&#23433;&#12290;&#26368;&#22909;&#26159;&#30830;&#23450;&#20027;&#33394;&#21518;&#65292;&#23567;&#38754;&#31215;&#20351;&#29992;&#20123;&#21576;&#40092;&#26126;&#23545;&#27604;&#30340;&#33394;&#24425;&#12290;&#20837;&#22799;&#36141;&#32622;&#19968;&#20123;&#33394;&#35843;&#28165;&#20937;&#30340;&#39280;&#29289;&#25670;&#35774;&#65292;&#26159;&#26368;&#30465;&#38065;&#26377;&#25928;&#30340;&#19968;&#25307;&#65292;&#22914;&#20026;&#21488;&#28783;&#25442;&#20010;&#30333;&#33394;&#28783;&#32617;&#12289;&#22312;&#27927;&#25163;&#38388;&#25918;&#19968;&#22871;&#20912;&#34013;&#33394;&#30340;&#27792;&#28020;&#29992;&#20855;&#31561;&#12290;(UU&#20026;&#24744;&#25552;&#20379;&#29983;&#27963;&#21672;&#35759;&#24182;&#31069;&#24744;&#29983;&#27963;&#24841;&#24555;&#65281;&#22914;&#19981;&#24076;&#26395;&#25171;&#25200;&#35831;&#22238;&#22797;?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg"

    Perhaps you should check the version of Java you are using. I am using 1.4.2_04
    public class A {
        public static void main(String[] args) throws UnsupportedEncodingException {
            String text = "FWD: test_tancy: FWD: tancy: FWD: supporter:                   " +
                    new String(new char[]{(char) 35201, (char) 35753, (char) 23621, (char) 25152, (char) 30475, (char) 36215,
                                          (char) 26469, (char) 28165, (char) 29245, (char) 20937, (char) 24555, (char) 65292,
                                          (char) 21487, (char) 37319, (char) 29992, (char) 20197, (char) 30333, (char) 33394,
                                          (char) 20026, (char) 20027, (char) 35843, (char) 30340, (char) 24067, (char) 32622,
                                          (char) 12290, (char) 30333, (char) 33394, (char) 19981, (char) 20294, (char) 33021,
                                          (char) 22686, (char) 21152, (char) 31354, (char) 38388, (char) 24863, (char) 65292,
                                          (char) 36824, (char) 33021, (char) 33829, (char) 36896, (char) 26126, (char) 24555,
                                          (char) 23425, (char) 38745, (char) 30340, (char) 27668, (char) 27675, (char) 65292,
                                          (char) 35753, (char) 20154, (char) 24773, (char) 32490, (char) 31283, (char) 23450,
                                          (char) 12290, (char) 21478, (char) 22806, (char) 65292, (char) 26377, (char) 24847,
                                          (char) 35782, (char) 22320, (char) 22686, (char) 28155, (char) 19968, (char) 28857,
                                          (char) 20919, (char) 33394, (char) 65292, (char) 20063, (char) 33021, (char) 20196,
                                          (char) 20154, (char) 22312, (char) 35270, (char) 35273, (char) 19978, (char) 35273,
                                          (char) 24471, (char) 30021, (char) 24555, (char) 12290, (char) 19981, (char) 36807,
                                          (char) 65292, (char) 19968, (char) 38388, (char) 25151, (char) 20869, (char) 33509,
                                          (char) 20840, (char) 37096, (char) 20351, (char) 29992, (char) 20919, (char) 33394,
                                          (char) 65292, (char) 25110, (char) 20840, (char) 37096, (char) 37319, (char) 29992,
                                          (char) 26262, (char) 33394, (char) 65292, (char) 20250, (char) 20351, (char) 20154,
                                          (char) 24863, (char) 21040, (char) 19981, (char) 23433, (char) 12290, (char) 26368,
                                          (char) 22909, (char) 26159, (char) 30830, (char) 23450, (char) 20027, (char) 33394,
                                          (char) 21518, (char) 65292, (char) 23567, (char) 38754, (char) 31215, (char) 20351,
                                          (char) 29992, (char) 20123, (char) 21576, (char) 40092, (char) 26126, (char) 23545,
                                          (char) 27604, (char) 30340, (char) 33394, (char) 24425, (char) 12290, (char) 20837,
                                          (char) 22799, (char) 36141, (char) 32622, (char) 19968, (char) 20123, (char) 33394,
                                          (char) 35843, (char) 28165, (char) 20937, (char) 30340, (char) 39280, (char) 29289,
                                          (char) 25670, (char) 35774, (char) 65292, (char) 26159, (char) 26368, (char) 30465,
                                          (char) 38065, (char) 26377, (char) 25928, (char) 30340, (char) 19968, (char) 25307,
                                          (char) 65292, (char) 22914, (char) 20026, (char) 21488, (char) 28783, (char) 25442,
                                          (char) 20010, (char) 30333, (char) 33394, (char) 28783, (char) 32617, (char) 12289,
                                          (char) 22312, (char) 27927, (char) 25163, (char) 38388, (char) 25918, (char) 19968,
                                          (char) 22871, (char) 20912, (char) 34013, (char) 33394, (char) 30340, (char) 27792,
                                          (char) 28020, (char) 29992, (char) 20855, (char) 31561, (char) 12290, (char) 20026,
                                          (char) 24744, (char) 25552, (char) 20379, (char) 29983, (char) 27963, (char) 21672,
                                          (char) 35759, (char) 24182, (char) 31069, (char) 24744, (char) 29983, (char) 27963,
                                          (char) 24841, (char) 24555, (char) 65281, (char) 22914, (char) 19981, (char) 24076,
                                          (char) 26395, (char) 25171, (char) 25200, (char) 35831, (char) 22238, (char) 22797}) +
                    "?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg";
            boolean isURL = text.matches(".*http\\S*(jpg|gif).*");
            System.out.println("isURL="+isURL+", length="+text.length());
    }Prints
    isURL=true, length=344

  • Email Regular Expression with a String.Match()

    I'm currently using a RichTextEditor for a user to build HTML
    for a site. However, I want the application to scan for emails and
    encode them so they are protected from spam bots when they go to
    the live site. I've written a regular expression to find an email
    and it seems to work, but it only returns one email at a time from
    the string. I have had to revert to a while loop to traverse the
    string until I'm satisfied. I don't particularly like that method
    and would like to just do one String.match() query to retrieve all
    of the emails. Can anyone see something here that I'm missing?

    Try adding the global flag (g):
    var emailPattern:RegExp =
    /[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]+/g;
    TS

Maybe you are looking for

  • IChat no longer works in video

    I was using video iChat with Panther successfully. Having installed Tiger on one of two hard drives I can now audio chat on both but video chat on neither. I get the message "cannot get video from the camera" whaen I initiate a call, and " erik forre

  • Bugs in DropShadow and Gaussian Blur?

    I just figured, that both effects create strange artifacts outside the actual node in my application (JFX 1, Update 1 on Windows XP). After checking the online doc and searching for some other nice looking effects, I realized, that these problems app

  • Import/Export Issues

    How to export oracle 9i database schema tables, views and other objects in to oracle 8 schema?

  • Referencing cells in different documents.

    Is it possible to reference cells in a different document? This is very important for me and if it's not possible I'll have to go back and use Excel again.

  • Apple trailers on apple tv2

    I just purchased an aTV2 and wanted to watch some of the trailers that are available on apple @ http://trailers.apple.com/ I can watch trailers from the in theaters catagory but not any other trailers that are listed on trailers.apple.com. Is there a