fb1990
asked on
Extract Specific Text
Can some please help me with a code snippet to extract specific text from a string Using T-SQL. In the case of the strings below, I want to extract text between the '=' sign and '&' sign. Sometimes the '&hl=en' is missing from the combination
Expected result
https://play.google.com/store/apps/details?id=com.barclays.android.barclaysmobilebanking&hl=en
https://play.google.com/store/apps/details?id=uk.co.hsbc.hsbcukmobilebanking
https://play.google.com/store/apps/details?id=org.coop.associatedschoolECU.coopmobile
https://play.google.com/store/apps/details?id=org.coop.associatedschoolECU.coopmobile&hl=en
Expected result
com.barclays.android.barclaysmobilebanking
uk.co.hsbc.hsbcukmobilebanking
org.coop.associatedschoolECU.coopmobile
ASKER
@david. Thanks for looking at the problem. Those are the values that I need to work on. I have tried this code snippet, it gets the &hl=en at the end of the url as well
SUBSTRING(STRING, CHARINDEX('=', STRING) + 1, LEN(STRING))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much, Mark. It worked!
My pleasure :)
HTTP != SQL.
Provide your schema + SQL statements you've tried along with your results + likely someone can assist.