Regex to find  word starting with $ symbol.

Hi,
I want to find all the words in a JTextPane starting with "$" symbol followed by alphabets or digits.
Below is the code, which I have written
public void matchAllWords(String textPaneData) {
     String regexStr =  "\\b(\\$?(\\w+))\\b";
     Pattern p = Pattern.compile(regexStr);
     Matcher m = p.matcher(textPaneData);
     while (m.find()) {
           System.out.println(m.group());
}Suppose the text pane data is
hello $world 2$ $test_string $50.0 $5*5
I want the method to match the following words
$world
$test_string
$50.0
But the program is printing:
hello
world
2
test_string
50.0
5*5
Please help me, where am I going wrong.
Thanks in advance.
Regards,
Vaishakh
Edited by: Vaishakh on Sep 16, 2009 4:24 AM

Thanks, as u said http://www.catb.org/~esr/faqs/smart-questions.html#writewell
How To Ask Questions The Smart Way
Eric Steven Raymond
Rick Moen
Write in clear, grammatical, correctly-spelled language
We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

Similar Messages

  • Search for all words in a table column that any of the words start with a certain letter

    I have products table. Each row has a Description which may have a few words within it. I wanted to know if it's possible to search through it and find all descriptions that have match the search. But, I want it to consider it a match even if it's not the
    first word of the description, but rather the start of any word in the description.
    For example:
    Descriptions
    Nice Casual Gloves(This should show up, and although it's not in the very beginning of the description it's at the beginning of a new word.)
    Nice Dressy Gloves(This should show up, and although it's not in the very beginning of the description it's at the beginning of a new word.)
    Great Dresses (This should show up)
    Fancy Outerwear
    Glasses (This should show up)
    Shoes
    Sheer Stockings (This should not show up because although it has a "g" it's not in the beginning of a word.)
    Boots
    Galoshes (This should show up)
    I would want to search within this list Where Description like 'G%' but I don't want it to only get the descriptions that start with "g" at the beginning of the description, but rather any "g" at the beginning of any word. I do not want
    to get all descriptions that have a "g" somewhere in the word (then I could just do WHERE DESCRIPTION LIKE '%g%'), rather only if it somewhere within the description but at the beginning of any word.
    Thank you so much
    Debra has a question

    The most perfect solution would be to get a CLR routine to either (a) Do a regular expression match, (b) Run a split routine at CLR speeds then do a simple LIKE, or (c) both (a) and (b).  If your requirements grow to handle more and more complex searches,
    you may have to do it that way eventually.
    However, like the other answers, here's a way to do it reasonably well given your current requirements.  You may have to tweak the REPLACE logic if you have frequent OTHER forms of word delimiters.
    Method:  Pull data; add space before and after original text; replace all common word separators other than space with a space (so for example, "(These pretzels)", "He said 'These pretzels are making me thirsty" and so forth would
    be replaced with a space before "The"; then do a Patindex (you could do with just a LIKE also) on the search string prefaced with a space.  Here's an example, stealing from table sys.messages just for ease of demonstration.
    With SampleData as
    Select top 100 *
    , ' ' + Replace(Replace(Replace(Replace(text, '"', ' '), '''', ' '), '/', ' '), '(', ' ') + ' ' as TextPlus
    from sys.messages
    where language_id = 1033
    Select TextPlus
    , patindex('% The%', textplus)
    from SampleData
    where patindex('% The%', textplus) > 1
    Same logic, in the most concise format:
    Select top 100 Text
    from sys.messages
    where language_id = 1033
    and ' ' + Replace(Replace(Replace(Replace(text, '"', ' '), '''', ' '), '/', ' '), '(', ' ') + ' ' like '% the%'

  • ABAP code to find records starting with Z or Y

    Hi,
    I am trying to find the records in a SAP table, where all the values for a particular field start with Z and Y. What is the coding statement for this?
    I tried this but it does not seem to be correct.
    SELECT field
        FROM table
        INTO TABLE t_itab
        WHERE field LIKE 'z*'.
    Can someone correct me or suggest me the best solution for this? Thanks.
    Moderator message - Unfortunarely, this is not a training forum. You can get a lot of information using F1 - thread locked
    Edited by: Rob Burbank on Nov 24, 2009 4:25 PM

    If you have to do in urself
    DATA: i_reptx TYPE STANDARD TABLE OF textpool WITH HEADER LINE.
    READ TEXTPOOL 'ZJ_ALV' INTO i_reptx.
    and describe the itab.. and get  the lines.
    In conjunction with TADIR table to get the program repository.

  • Where can I find "Getting Started with AppleScript"?

    I googled it. And it doesn't show any links from Apple. I'm trying to learn AppleScript and the Language guide says to go through the Overview first which in turn recommends going through Getting Started with AppleScript.
    I even searched Mac Reference Library but it just doesn't show up!
    Any help?
    Neerav

    No, certainly not. I mean, I don't know any AppleScript, but I can say with certainty that the answer to that question is no.
    Objective-C is a programming language that is an extension of the C language. It is the language that is used to develop applications for Mac and iPhone. Other languages like C++ and Java can be used as well, but Objective-C is the language that Apple really intends for you to use for Mac and iPhone development, since it is heavily integrated with the Cocoa framework (for Mac developemt) and Cocoa Touch framework (for iPhone development). You need to know the C language to learn the Objective-C language, and you need to know the Objective-C language to work with the Cocoa or Cocoa Touch frameworks, but AppleScript is a totally separate and different animal from these things. AppleScript is a scripting language, and although it can technically be used to create applications from what I understand, it is mainly used as a mechanism for controlling applications. For example, you could use AppleScript to tell a certain application to perform a certain task everyday at a certain time. You can use it to create automated workflows and whatnot. I think that's what it's mainly meant for.
    It's worth noting, however, taht there is a development environment called AppleScriptObjC. I don't really know anything about this, except that it allows for AppleScript to be used as the primary programming language.
    I found a lot of this information at [Wikipedia's AppleScript page|http://en.wikipedia.org/wiki/AppleScript], so you might want to consider looking over it real quick -- it might be helpful. Here is the link to [Wikipedia's Objective-C page|http://en.wikipedia.org/wiki/Objective-c] and [Wikipedia's Cocoa page|http://en.wikipedia.org/wiki/Cocoa_%28API%29]. As someone said on these forums, Wikipedia is far from the last word on any subject, but those links might be helpful for you for just getting an idea of what these things are all about.
    Hope that helps some. Please let us know if you have any other questions.

  • Want Finder to start with active windows

    Under previous OSX, mac would start at login with two active Finder  windows, on the second display alogside Mail. Mavericks won't do this. Is there a way to have Finder start with one or more active windows? Thanks.

    In addition to the previous answer, uncheck the box in System Preferences > General: Close windows when quitting an application..

  • Finding filename starts with 's' like pattern matching

    HI,
    I have a requirement like if i give 3* in input field.. what are the ticket numers starts with 3 it should display,,can any 1 suggest me how to do this ?for ex..tickect numbers like 3143,3153,3163 ,if i give 3* it should display all the numbers 3143 3153 3163

    Hi Vasavi,
    I think you are looking something like this...
    http://help.sap.com/saphelp_nwes72/helpdata/en/8c/20efbd1b0a463ba5914356f01de03f/content.htm
    this is new feature 7.02 onwards.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/54/07ec96bd5a4764be4996fff231b4de/content.htm
    Cheers,
    Kris.

  • HT201401 my iphone is not starting  n starting with symbol that connect  with itunes..... nw what can i do...\

    ma iphone is not workin n showing a symbol "connect with itunes"

    So connect it to iTunes, and restore it.

  • Reading an initial letter from a line in java and printing the word starting with the initial letter

    suppose this is a string in java char str[]="this is the future" my program should work like this 
    it should check the initial letter in this case 't' and print the words 
    output should be this the

    I think you can better ask this in a Java forum. This forum is about the Small Basic programming language.
    Jan [ WhTurner ] The Netherlands

  • Crazy Text in my Finder Most start with the letter "N"

    Here are some screen shots...
    http://www.avicreative.com/macprob/CrazyText.jpg
    http://www.avicreative.com/macprob/CrazyText2.jpg
    I am getting some crazy text where my "Open With" and "Copy" "Paste" are usually located as well as in my "Get info" box. The Size should be in Gigs, not "IN_G" or something like that. Has anyone has this prob?
    PowerBook G4 1.5 GHz Mac OS X (10.4.6)
    PowerBook G4 1.5 GHz   Mac OS X (10.4.6)  

    I've seen this happen before, and generally turning off Documents and Data in Settings > iCloud will fix it.
    If that doesn't work, try the following.
    1. Restart the phone and check it out.
    2. Reset the phone (hold the home button and the lock button until you see an Apple Logo and then let them go).
    3. Go into Settings > General > Reset > Reset all Settings and test it out again
    4. If none of the above work, try creating either an iTunes backup or an iCloud backup and restore the device as new using iTunes. Here's an article to help with that: http://support.apple.com/kb/ht4137

  • Word Starter 2010 not recognized when opening DOCX documents

    When I use Word Starter 2010 to create documents (as .docx) the documents do not recognize Word Starter as the originating application. It is necessary to open Word Starter and then open the .docx document from within Word Starter. I tried to associate
    Word Starter with the document type using the default program tab in the control panel, however default program does not find Word Starter application. Also having problem with Windows Live Mail where mail with .docx attachments are rejected as dangerous file
    types. Running System 7, current on updates - any suggestions??

    These problems were caused by a recent Windows update. Try repairing Office (via Programs & Features > Microsoft Office > Change in the Windows Control Panel).
    Cheers
    Paul Edstein
    [MS MVP - Word]
    Thanks for your help!!!  Going into Control Panel and doing the repair seems to fixed the problem for me.  I realize that it is not your fault that it was broken.   However I have to ask, if Microsoft knew that their Windows update broke certain
    functions or features in Office, then why didn't Microsoft fix the problem rather than having a whole lot of pissed off users who don't understand why Office isn't working anymore?  It would have saved me 90 minutes of looking for solutions (or buying
    one of the "recommended" Office packages--maybe that is why MS is not fixing the problem they created). 
    Happy Holidays!

  • How to start with ORACLE APPS and ORACLE APPLICATION SERVER?

    Hi !!
    I am a little known with oracle database. But recently i have been asked to update my skills with oracle apps and oracl e application server. I do not have any prior experience with these products of oracle and I really have 0 knowledge of it.
    Can anybody help me find a start with oracle apps and oracle as?
    Thanks.

    Welcome
    http://www.oracle.com/technology/documentation/applications.html
    You can download from here.
    Regards
    Asif Kabir
    -- If helpful mark the post as correct/helpful, also close the thread as answered.

  • 'Connect By' and 'Start With' in Discoverer

    Hello,
    I have a hierarchal query to show all child organizations under the parameter ':Parent_ID'
    This is the query, I execute it in SQL Developer normally:
    SELECT el.organization_id_child, ch.name,level*
    FROM hr.hr_all_organization_units org,*
    hr.PER_ORG_STRUCTURE_ELEMENTS el      ,*
    hr.hr_all_organization_units ch*
    WHERE el.org_structure_version_id         = 61*
    AND org.organization_id                     = el.organization_id_parent*
    AND ch.organization_id                      = el.organization_id_child*
    START WITH el.organization_id_parent = :Parent_ID*
    CONNECT BY el.organization_id_parent = PRIOR el.organization_id_child*
    in the below line:
    START WITH el.organization_id_parent = :Parent_ID*
    The hierarchal query will start with parameter value to show all childes under that organization...
    How can I use this simple query in Discoverer !! I am trying to find the START WITH in the discoverer also can not put this query in a new custom folder without removing the parameters.
    Please Help...
    Regards
    Edited by: adelshehri on Oct 21, 2009 2:47 PM

    Hi,
    If you need to use the hierarchical query then you will not be able to pass a Discoverer parameter directly to the start with clause in the custom folder.
    However, you can use a database context as a session parameter and use this parameter in the customer folder. More details on this can be found at LearnDiscoverer
    Also you could put your hierarchical query into a table function passing the parent_id as a parameter to the table function. Then in your custom view you would join this to a table that returns the list of parent ids that you wish to use. e.g.
    select f.organization_id_child, f.name,level
    from hr.hr_all_organization_units par
    , table (hierarchy_function(par.parent_id) f
    where par.organization_id = :parent_id
    Rod West

  • Finding Words with more than Two Vowels (Regex)

    Hello all, I've been working on this for quite some time now.  I need to use a regular expression to find words that contain more than two vowels.  I am getting stuck.
    Here is what I have so far.  I am using emacs to find them in a text file.
    I use C-M-s and the expression /<[^aeiou]*[aeiou][^aeiou]/>
    It finds words with one vowel, but I need to find if it has more than two, and I'm not sure how to go about doing that.
    Any help is appreciated!

    alphaniner wrote:
    This better not be a homework question...
    [aeiou].*[aeiou].*[aeiou]
    or, more succinctly (I think...)
    \([aeiou].*\)\{3\}
    I tested it with grep on a file with one word per line.  Seems to work in that context.  More than one word per line and it breaks.  I know nothing of emacs or your data, so I have no idea if it will suffice.
    I'd also suggest you go back over your expression and put into words exactly what you think it is doing.  I'm no regex expert, but it doesn't seem at all fit for what you're trying to do.
    Thanks that seemed to work!

  • Have just migrated from the world of PC's. and I had my set up so that when I typed a new sentence it started with a capital with out me pressing shift. also, i could set up words to self fill like ur would auto correct to your. can this be done with mac

    Have just migrated from the world of PC's. and I had my mail text typing set up so that when I started  a new sentence after a full stop  it started with a capital with out me pressing shift. also, i could set up words to self fill like ur would auto correct to your. can this be done with mac

    I don't know about the first letter cap but the spelling is simple. Edit - Spelling and Grammar - Select While Typing and Correct Spelling Automatically.
    I'd also STRONGLY recommend that you bookmark and use:
    Mac 101
    Switch 101
    Find Out How Video tutorials
    List of Useful URLs for switchers
    Welcome to the Light side.

  • Regex: for any word, find word+s and y/ies

    Hi all
    This sounds pretty simple, but I'm trying to create a regular expression whereby, for any word, the matcher will find all instances of that word OR it's plural.
    Now, if it were just adding +s, I know I could do Pattern.compile("\b\Q" + word + "\Es?\b");
       // note, this forum seems to spaz when I use double-slashes, so I omitted themHowever, if it ends in a "y", like "try", I need to find words that end in "ies", like "tries".
    At first I thought of making two cases in the pattern, one as above, and one were the last letter is subtracted and you check for (y|ies). HOWEVER, without first knowing if the word ends in a "y", it could take "do" and change it into "dies", and then mistakenly find it.
    Of course, I COULD have a whole bunch possible patterns seperated by a bunch of IF-THENs... "if it ends in a y, Pattern pattern = Patern.compile(...."
    ... but this doesn't seem very elegant.
    So, how can I create a pattern that will check for "ies" ONLY if the word ends in "y" (and +"es" if it ends in an "s" and so on...)?
    Thanks!
    Tim

    <div class="jive-quote">
    <span class="jive-quote-header">uncle_alice wrote:</span>> ... but this doesn't seem very elegant. If you really want to do it right, you'll use a stemming algorithm, but if you stick with regexes, the brute force approach you've already outlined is as elegant as it gets.
    </div>
    You'll also need a stronger definition of plural. I don't know how in-depth you need this to be, but some words are pluralized by adding "es" or "ues", some by changing "us" to "ii", etc. I really can't see how using regex is going to make this easier.

Maybe you are looking for

  • "evdre encountered a problem retrieving data from the webserver"

    Hi We are using a big report which takes very long time to expand and sometimes we get the error message "evdre encountered a problem retrieving data from the webserver" when expanding the report, but not very often for most of our users. But we have

  • Error in system Copy

    Hi Gurus, I am doing Homogenous system copy  (ABAP/JAVA) in new hardware and have encounter the Follwoing error at "Create SAP stored Procedures" in SAPINST. System is on win2003 / MSSQL2005 with latest patch. Please advise the solution ERROR      20

  • ATI/Radeon 9800 Pro 128 AGP 4x/2x in Gigabit Ethernet dual 450 PMac G4

    Hi, This is my first time posting to these discussion group... I've been going through related threads and have not found an answer to my problem... I have a Gigabit Ethernet dual 450 G4. Awhile ago I upgraded the processor to a Sonnet 1.8ghz so I co

  • Delivery of sales order problem

    Hi Experts, Can anybody solve my problm please. While delivery of sales order in VL01N I am facing following error. No delivery-relevant items in order 0000000029, order type OR Diagnosis: The sales order you want to deliver, sales order 0000000029 w

  • InDesign CC, can't export to html, can't access unneeded file

    In the latest build of InDesign CC (July 2014), the export process to HTML has changed. You used to be able to export a book directly to filtered HTML files. Now the option is no longer in the Book menu, and you must go through the main menu, which d