Regex expert needed ;)

Hello
I am using java.util.regex.*, but I am not exactly a regex expert. This is drivin' me crazy, plz help ::)
From:
"<p>I want to <a>extract</a> this</p> blah blah <p>I want to extract this too</p>asdf"
I want to extract:
"<p>I want to <a>extract</a> this</p>"
and:
"<p>I want to extract this too</p>"
(this is an an example, of course)
If i use a regex like "<p>.*</p>, I get the biggest substring that satisfy the regex:
"<p>I want to <a>extract</a> this</p> blah blah <p>I want to extract this too</p>"
and this is not want I want. Suggestions of a regex that would match the 2 strings written above?
thx

I suggest to use tags as delimiters:
String tokens[] = source.split("<a>|</a>|<p>|</p>");
or could be "<[a-z]+>"...

Similar Messages

  • LabView expert needed ASAP

    LabView expert needed ASAP to help complete a project. Specific skills
    needed are database connectivity experience with the LV Database
    Toolkit. Initial phase is approx. 15-20 hours of work with the
    potential for much more if we find the right person. Must be in Austin,
    TX for initial on site work.
    Job location is Austin, TX.
    Compensation: $50-75/hr

    Hello,
    My name is Robert Bohannon and I reside in the Denver, CO area. I’ve attached my resume for your review. I have been doing automated test system development for over 15 years and have been an independent consultant for over 5 years. I’m writing you to express my interest in your job posting in the LabView Job Openings Forum. I am currently looking for contract opportunities and I believe that my services could be of great value to you.
    Please review my resume and if you find any experience of mine that may potentially fit your job requirements, please let me know. I will provide references upon request.
    Thank you for your time.
    Robert Bohannon
    Attachments:
    resume.2006.05.21.pdf ‏315 KB

  • Regex help needed

    So i need to write 2 regexes, one needs to match the following:
    somedomain.com where somedomain can be any length
    another regex that matches the following:
    someword-international.com or something-intl.com
    the regexes must be mutually exclusive.
    the problem i am having is that if i write
    [^int].*?\\.com
    as the first regex, then it wants to have atleast 3 letters which arent "int" so i cant have aa.com match correctly for the first regex

    i am looking for an address which has the word intl or international before the .com
    that is the difference, if the string has intl or international before the .com then it matches #2, else if it ends in .com and doesnt have intl or international before the .com then it matches #1

  • My dashboard taking long time to load in ipad compared to Desktop. Experts need suggestion to tune my dashboard.

    Hi Experts,
             I have developed dashboard with BEX query as a source(9 queries used in dashboard). This dashboard opens in 40 secs in BI launchpad but if I open same dashboard through SAP BI app it almost taking 3-4 min. Is there any ways to improve performance in Ipad?
    Info of Dashboard
    * 20-25 components using in dashboard
    * 100-150 formulae are used(VLOOKUP)
    * SAP BO 4.0 SP6 I am using
    Please need some tips to improve performance.
    Regards
    MAHANTESH

    Hi MH,
    Opening the dashboard in 40 secs in desktop is also a problem before jumping in to the ipad. Maximum it should take 5 - 10 secs to open the dashboard then only the clients will show interest on working with dashboards.
    * 20-25 components using in dashboard
    >>Check for unused components and try to remove it from the dashboard.
    * 100-150 formulae are used(VLOOKUP)
    >>Try to minimize the formula in excel, because the excel formula will throw lot of load at the time of processing the data. Instead of lookup's try to use index formula which is better than that.
    1. Use "Refresh after components are loaded" which will make you components gets loaded first then the data comes.
    2. File menu --> document properties. "Show Loading status" which explains or dashboard where it takes time to load.
    Xcelsius performance optimization- tips &amp;amp; tricks - Business Intelligence (BusinessObjects) - SCN Wiki
    1430976 - BICS remote & Xcelsius performance improvements
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0ab8cce-1851-2d10-d5be-b5147a651c58?QuickLink=index&…
    Hope this Helps!!!
    Revert for any clarifications.
    --SumanT

  • Hi Experts need some clarity on these topics

    Hi Experts,
    Can anyone please guide me through the following questions
    1. What is summit implementation menthodology?
    2. What is the use of these different sevices?
    u2013 Shared Query Engine
    u2013 File Service
    u2013 Authentication
    3. Who will be the System Administrator( who can create App Sets)?
        How many Application Administrators will be in the team (who can create Applications)?
    Thanks and Regards,
    Sireesha.

    Hello,
    The Summit implementation methodology was a methodology used by Outlooksoft to implement the product. After the acquisition of Outlooksoft by SAP and gthe subsequent rebranding of the product into BPC, SAP has integrated different sets of implementation methodologies into the SAP ASAP (Accelerated SAP) methodology, which is SAP's way of doing things. Currently, SAP Expertise centers are rolling out these methodologies into BPC projects.
    Shared query engine: is the query engine BPC uses in the background to get queries and results back and from the server. Depending on the type of input the user has done/report the user need, the engine decides how to get this request handled, where to store the data and where to get the results from. The shared query engine runs on the application server.
    File Service: whenever you store pre-built reports onto the server or datafiles to be used in datamanager, basically anything that involves the user, admin or system doing something with files, these files are stored in the Webfolders (altough these may be called BPC folders these days)  directory and the file service hadles this traffic.
    Authentication: well basically you have user authentication setup using the security setup from BPC 9in the Admin tasks). This restricts users to have access to certain tasks, entities or other secured diemnsions. So the whole security setup determines authenticication on the server to what a user is allowed to do, see, to input or to edit. Then you have also authentication in the backend (between servers). This is osmething an admin should not worry to much about as the system is supposed to handle this for you. For instance, a datamanager package authenticates itself at the SQL server to store data into its tables. So there is a system authentication service too that decides if a datamanager job is allowed to talk to this SQL server instance. But agina, these technical authnetications probalby should not worry you as an admin or superuser as the system handles those. Of course IT people might e interested to figure out what services need certain types of authentication, but in general, even they should not bother too much as this all comes with the BPC design and they cannot do a lot about it anyway, just give the correct rights to certain services (as described in the installation manual)
    Finally, how many admins can there be ?
    Well you will have a pute technical systems admin somewhere who handles master password and stuuf. But that person is not a BPC admin in the true sense. Again, any IT organisation has those people. From the functional side, you should of ocurse have at least one admin, but you can vary the number based on functional requirements or maybe requirements that come from a segregation of duties principle that has been determined by an audit department. In general, you will find that the audit guys want as little admins as possible, but from an operational perspective it is normal to have at least 2 or 3 people who "manage" the system form a functional perspective.
    Hope this helps,
    Edwin van Geel
    SAP BPC EMEA

  • JTable Experts Needed :-)

    Hello JTable Experts,
    I have to build a planning application whose one screenshot is below.
    http://nicolasjouve.free.fr/public/sample.PNG
    My question is : should I use a JTable and customp 2D painting, or should I go for full Java2D ? I have to add that you may drag one card from a slot and put it in another one. Please note the mutiple lines header and multi column left header and the "cartoon like" captions in yellow....
    Thanks in advance,

    Well I don't see any huge features in your screenshot that would be too hard to implement.
    Basically the column and row header are not supported by standard JTable (colorizing stuff is easy).
    I would advise to use separate JTables for row and column headers (in additioin to main table), so you will need to synchronize scrolling. But this could be done. No need to make a custom component.
    If you decide to design a new component, be sure to take the JTable source code and modify it (the best way is subclassing the existed classes).
    Creation of new component from scratch could be quite difficult especially if you want it to be consistent with different LAFs.

  • Regex Assistance Needed

    Greetings,
    I have not really used regex very much in my code thus far and now need to and would like someone who has more knowledge than I point me in the right direction.
    Here is what I am trying to do...I have created a login.cfc for our customers on our website, which utilizes a web service from our Oracle instance to instantiate them to our Oracle customer db. I am attempting to create a link where our customers can submit a srevice request to us via Oracle right from our website. Because Oracle uses session variables in thier links, I thought of utilizing cfhttp to pull the page with the link and thus the session data back into the FileContent piece. I want to parse through the html and find the correct create service link. Has anyone done something like this before? Can someone point me in the right direction to wrtie a regex to pull the <a> links into an array?
    Thanks in advance,
    Clay

    Hi Clay,
    You can make use of either one of the below UDF's,
    http://cflib.org/udf/ActivateURL
    http://cflib.org/udf/hrefsToList
    HTH

  • Regular expression expert needed

    what is the diffrence between String s;
    s.split("\[,\]");
    and
    s.split(",");
    ?

    flounder wrote:
    Basically no difference. The square brackets are used for a group of delimeters (not sure of the exact regex terminology). The square brackets are called character classes or character sets.
    flounder wrote:
    So if I had "[abc]" then it would split on either an 'a' 'b' or 'c'. So in your example having only a single char inside the brackets is pointless.You can see character sets as a mini-language inside the regex language. The normal meta characters from regex do not apply inside character sets, they have their own meta characters, which are the '-' and '^' (besides the square brackets themselves, of course). Also, these two meta characters need to be placed at certain places inside the character set to be valid. The '-' is a range indicator only between two characters, but not when placed at the start or end of a character class. And the '^' is a negation character only when placed a the start of a character class, otherwise it will just match the characters '^' itself.
    Some examples:
    [a-c]   // matches 'a', 'b' or 'c'
    [-ac]   // matches '-', 'a' or 'c'
    [ac-]   // matches 'a', 'c' or '-'
    [^ab]   // matches any character except 'a' and 'b'
    [a^b]   // matches 'a', '^' or 'b'
    [.?*]   // matches '.', '?' or '*'

  • Layering expert needed

    I am looking to hire an expert with video layering to assist with a video-layering demonstration.  Is there a reference resource for such needs?

    Thank you all for the suggestions but I guess I should have been more clear - I'm looking for a list of video layering experts to hire.  I don't have the time or money to become expert myself.  I need someone who I can hire to work on a hoax video along the same lines as those where a guy gets hit by a car after falling down a lot of stone steps, or similar to the recent one showing the naked guy climbing out Buckingham palace.  I'm making a hoax video and need a layering expert to assist.
    Thanks,
    Steve

  • Regex list need for speed

    Hi,
    I'm facing the problem to classify a continuous stream of long strings using a list of regex, if a regex matches the system assigns a class to the string; all the regex (>200) have to be evaluated, hence many classes could be assigned to the string.
    Obviously the speed is crucial requirement.
    Any suggestion ? Are regex the best choice?
    Thanks
    n.

    To demonstrate what prometheuzz was talking about, here's a much more efficient version of your regex: "\\bhttps?+://[-a-zA-Z0-9]++.abcdefg.com" +  // domain
    "(?>:[0-9]++)?+" +                           // optional port
    "(?>/[-a-zA-Z0-9+&@#/%=~_|!:,.;]*+)?+" +     // optional path
    "(?>\\?[-a-zA-Z0-9+&@#/%=~_|!:,.;]*+)?+"     // optional parameters All the quantifiers are now possessive, most of the groups are gone, and those that remain are not just non-capturing, they're atomic, for even greater efficiency.
    If you need to test several regexes against the same string, you can cycle through them efficiently with Matcher's usePattern() method: for (Pattern p : patternList)
      if (matcher.usePattern(p).matches())
        // bingo!
    } You can even apply the regexes within a larger string (or preferably a CharBuffer, if you're reading the text from a stream) by using the lookingAt() method instead of matches(). That's a bit more involved; I'll elaborate if you're interested.

  • Forensic Expert needs help with FCP

    Hi,
    I recently purchased FCP and I am a forensic audio expert.
    I want to use this in court presentations as well as the occasional talk show appearance. I have a pretty good grasp on the functions and capabilities but I have two very important questions to ask.
    1. I want to be able to visually display an Audio Wave form that moves in real time with the audio track for transcription purposes and court room presentation. In other words, I want the jury to be able to see either a spectrograph or wave form on a large screen while the transcript is superimposed on top of it. I am not worried about getting the text on the screen but I can't seem to figure out how to display the audio in either format visually moving in real time.
    2. Are there any other forensic experts out there using FCP that might be willing to share some secrets or scripts with me?
    Arlo
    Please respond with an email to [email protected]

    I don't know whether this will help but Sound Studio (that was bundled free with Macs a year ago) has some splendid, huge waveform displays.
    Sound Studio 3 costs $80.
    Sound Studio 2.2.4 has no price listed - I don't know whether it is free - but you can download it to test it:-
    http://www.felttip.com/products/
    Ian.

  • Message mapping problem / experts needed / UDF?

    Hello experts,
    I have the following problem in a message mapping:
    Source structure is as follows:
    - Node a (min 1, max 999)
      - Subnode b (min 0, max 999)
      - Each Subnode b has the element "number" (1,1)
    This structure must be mapped to the following target structure:
    - Node c (1,999)
       - Subnode d (0,999)
       - Each subnode d has the following elements:
           - e1
           - e2
           - e3
           - e11
    1 Source node a should create 1 target node c.
    All numbers in all subnodes b of one source node a should be mapped to the e1, e2,...e11 elements of the target structure. As one target node d can only contain up to eleven numbers, there must be several d nodes.
    I have already tried to create a UDF, but it does not work.
    Any experts who would like to share their knowledge?
    Thanks in advance.
    CHRISTOPH
    Edited by: Christoph G. on Apr 23, 2008 10:46 PM

    Hello again,
    meanwhile I have worked hard on it and I have found the solution (just one UDF (queue function) which gets the article numbers as well as constant(targetField). So the UDF covers the creation of the "groups" as well as the mapping of the article numbers.
    It was really interesting and it made me ambitious to find the solution myself I do not have access to the system today, but I will post my solution as far as I have access again. Maybe you still want to search for a solution? It really may be fun, just like some kind of a puzzle game.
    In order to make it more clear, here comes the source and target structure with an example. Let me once more explain it: In the source, there are positions, each with unlimited article numbers. Each position will create a targetPosition. The node "targetPosition" has the subNode "articlenrs" (unbounded). Articlenrs has 11 differnet elements, calles a1, a2, a3, ..., a11. That means, all article numbers from a source postion should be mapped to "groups of 11 target article numbers". Please be aware the there are 11 differnet target fields for article numbers: a1, a2, ... a11.
    I think that' why the solution of  Liang Ji and Rohit Kalugade will not work...
    SOURCE
    <position>
         <articlenr> 123   </articlenr>
         <articlenr> 456   </articlenr>
         <articlenr> 4783 </articlenr>
         <articlenr> 123   </articlenr>
         <articlenr> 456   </articlenr>
         <articlenr> 4783 </articlenr>
         <articlenr> 123   </articlenr>
         <articlenr> 456   </articlenr>
         <articlenr> 4783 </articlenr>
         <articlenr> 123   </articlenr>
         <articlenr> 496   </articlenr>
         <articlenr> 4783 </articlenr>
             . (unbounded)
    </positon>
    <position>
         <articlenr> 543  </articlenr>
         <articlenr> 865  </articlenr>
         <articlenr> 643  </articlenr>
    </positon>
    TARGET
    <targetPosition>
      <articlenrs>
           <a1> 123  </a1>
           <a2> 456  </a2>
           <a3> 4783 </a3>
           <a11> 496 </a11>
      <articlenrs>
      <articlenrs>
           <a1>4783 </a1>
      </articlenrs>
    </targetPosition>
    <targetPosition>
         <articlenrs>
         <a1> 543 </a1>
         <a2> 865 </a2>
         <a3> 643 </a3>
            </articlenrs>
    </targetPosition>
    Thanks,
    Christoph
    Edited by: Christoph G. on Apr 30, 2008 10:20 AM

  • MDN Issue in AS2 adapter.. Seeburger experts., Need help

    Hi All,
    Iam doing a scenario EDI-->Idoc for purchase order(ORDERS) by using AS2 adapter.
    We are expected to send the technical acknowledgment once we receive the Orders from sender.
    I think When we use the MDN (Message disposition notification), i will be getting the system generated acknowledge like below.
    <b> <TransmissionReport>
    <from>SAP</from>
    <to>BIS</to>
    <transmissionMsgID>43cc21a0-f752-11d8-c8ca-00c09f19e074</transmissionMsgID>
    <sentAt>2004-08-26T132252+0200</sentAt>
    <info/><adapterName>AS2</adapterName>
    </TransmissionReport></b>
    But my requirement is to send the ackowledgement with few more details like <b>POnumber</b> along with the standard details like below.
    <TransmissionReport>
    <from>SAP</from>
    <to>BIS</to>
    <transmissionMsgID>43cc21a0-f752-11d8-c8ca-00c09f19e074</transmissionMsgID>
    <b><POnumber>6529833</POnumber></b>
    <sentAt>2004-08-26T132252+0200</sentAt>
    <info/><adapterName>AS2</adapterName>
    </TransmissionReport>
    1. Is there any option where i can modify the MDN acknowledgement file by adding few more fields??
    2. If not please suggest me how i can proceed with this.
    <b>Note:</b> We should not use by creating one more msgtype in SAP and send back the acknowledgement like Orders response(ORDRSP). They just want the file from XI itself.(But not from SAP Side).
    Regards
    Seema.
    Edited by: Mike Pokraka on Jul 24, 2008 1:43 PM

    Hi Reddy,
    If ur problem is solved can u plz help me?
    I have one question related to the MDN .
    My scenario is like AS2 adapter is on the receiver side means its converting XML to EDI format. When the payload along with MDN is sent from the XI side EDI partner , the EDI partner sends back the MDN acknowledgment back to XI.
    The problem is that XI is not able to accept the MDN acknowledgment.
    Could you please suggest what all steps need to be configured to receive that MDN acknowledgment on XI side.
    e.g 1)AS2 Communication channel with message protocol REPORTS
    2)Sender agreement for accepting the acknowledgment
    3) What type of message interface is to be used which is required in the configuration step for sender agreements(MDN specific format??)
    4) Any other configuaration required ??
    Please reply as soon as possible.
    With regards,
    Simran

  • Hi Experts need to know the user exit how to find out MV50AFZ1

    Hi experts,
    How to find the user exit i already tried with cmod ->utilities-> find exit and giving package name but not getting it please can u tell how to find it MV50AFZ1
    Regarding
    anil

    HI,
    Chek the following Exits..
    Exit Name           Description
    V02V0001            Sales area determination for stock transport order
    V02V0002            User exit for storage location determination
    V02V0003            User exit for gate + matl staging area determination (headr)
    V02V0004            User Exit for Staging Area Determination (Item)
    V50PSTAT            Delivery: Item Status Calculation
    V50Q0001            Delivery Monitor: User Exits for Filling Display Fields
    V50R0001            Collective processing for delivery creation
    V50R0002            Collective processing for delivery creation
    V50R0004            Calculation of Stock for POs for Shipping Due Date List
    V50S0001            User Exits for Delivery Processing
    V53C0001            Rough workload calculation in time per item
    V53C0002            W&S: RWE enhancement - shipping material type/time slot
    V53W0001            User exits for creating picking waves
    VMDE0001            Shipping Interface: Error Handling - Inbound IDoc
    VMDE0002            Shipping Interface: Message PICKSD (Picking, Outbound)
    VMDE0003            Shipping Interface: Message SDPICK (Picking, Inbound)
    VMDE0004            Shipping Interface: Message SDPACK (Packing, Inbound)

  • IMac CRT Tube Expert Needed

    Hi. I need to cut the CRT Tube of my iMac 350 G3 into half with a circular saw (the one with that looks like a grinding flat circle thing with bits of diamong/sandpaper like texture, using a Bosch drill). Is this safe? Would there be toxic gases or materials that will spew out the tube? How think is this CRT Tube?
    God bless,
    Alvin
    applecatholic.com

    Completely, totally, horrendously unsafe. There is a strong risk of fatal electric shock, tube implosion (lots of flying glass) as well as exposure to hazardous substances including lead, mercury, barium, cadmium and phosphorous. If improperly managed, the health risks associated with human contact to these five toxic substances within the CRT can be deadly.
    So if you haven't already (in which case have someone post the hospital to which we should send flowers) DON'T!
    BTW, this forum is for the new Intel-based iMac. For future questions, please be sure to post in the forum for your specific hardware.

Maybe you are looking for

  • Hard drive issues mac pro 2008

    Im getting round to some major upgrade of hard drives. My machine runs on 2 x 2.8GHz Quad Core Intel Xeon with 10GB RAM I am wanting to put a SSD for applications and a 2TB internal hard drive for file storage and data. As the machine runs at 3Gb/s S

  • What's wrong with my Wi-Fi? (bug report attached)

    My wifi went out, and I seriously doubt that it's a hardware issue... Here's a diagnostic report I found: File title: 2014-03-18-205028.panic.ips {"os_version":"iOS 7.1 (11D167)","bug_type":"110"} Incident Identifier: 7717F6E8-1C9C-4680-A480-68595D9B

  • Can't drag and drop files onto desktop any more

    I have always been able to drag/drop files and images onto the desktop from within the body of an email message or a web browser window. Now it won't let me do that any more and I have no idea what has changed. The cursor "holding" the image never ch

  • Why are my iMessages sent from iOS (6.0) and OSX (10.8.2) being received in two different dialog boxes?

    I'm trying to unify my iMessages sent from my iPhone 4S and my rMBP. iMessages I send from my iPhone to my friend's iPhone is in one window, and if I send another from messages on my rMBP it is sent to a different contact box on my friend's phone. Is

  • Themes not working in imovie for ipad

    Themes not loading for imovie for ipad.  I can use the themes in the Trailers, but not in creating a themed movie.  Please help!