We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

how to use regex in java

keviin555
keviin555 asked
on
Medium Priority
339 Views
Last Modified: 2012-05-11
Hello ,
how to extract alt the alt "Vol atterri" from this string in java with Regex?

<a href="flightdetails.asp?FLIGHT_NUMBER=0594&amp;B_DATE=201104230000&amp;B_LOCATION_1=&amp;E_LOCATION_1=" target="_self"><img src="../../template/fr/images/ata.jpg" width="40" height="10" border="1" alt="Vol atterri"></a>

Open in new window


thank you
Comment
Watch Question

Author

Commented:
and to get TEXT from this please :
<span class="style2">TEXT</span>

Open in new window


thanx alot

Awarded 2011
Awarded 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Awarded 2011
Awarded 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2016

Commented:
Try the following - same for the other
s = s.replaceAll(".*alt=\"(.*)\".*", "$1");

Open in new window

Author

Commented:
thank you , work perfectly :)
ps : @for_yan , check your mail please
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.