|
Have you tried removing the http(s)?:// prefix?
|
|
|
|
|
Hi.
Yes I have done that, but for some reason I still get the src:" in the web page HTML matches. And I don't know why.
Do I have to ignore that Somehow with a /S?
Regards
|
|
|
|
|
I guess that is correct, you will need to strip that manually somehow. Alternatively check if there is some other match that prefixes all the links that do not start with http(s).
|
|
|
|
|
Hi all,
I have a string "Gender: Female Race: American Asian". I would like to extract the following substring from this string.
"Gender: Female"
Any suggestions how I could accomplish this?
Thanks,
Ana
|
|
|
|
|
How about making a little effort yourself now we have shown you how to do it? And I also gave you a link yesterday where you can try out lots of different samples.
|
|
|
|
|
Okay, thanks. I will use the link that you posted to try out some samples.
|
|
|
|
|
Hi Richard,
I am using your link in one of your earlier posts for the regex tool. However, I am not able to sign in. Any help would be appreciated.
Thanks,
Ana
|
|
|
|
|
You do not need to sign in. Just use the what you see.
|
|
|
|
|
|
Hi Richard,
I was able to extract the intended substring by using "Gender: (.+?)".
Thanks for all of your help!
Ana
|
|
|
|
|
Hi,
I went to the link "https://regexr.com/. However, I have not been able to figure out how to use it. Is there any documentation available for reference?
Thanks,
Ana
|
|
|
|
|
Yes, the documentation is right there on the front page. You put your own test data into the box labelled "Text". Then add your regex in the box titled "Expression". The menus on the left point you to the documentation for all the regex types. What could be simpler?
|
|
|
|
|
Hi all,
I am looking for a regular expression to extract everything following a string and before a space. Please see the example below.
Order placed at the store. Order Date: 01/12/2017 This was completed.
From the above string, I would like to extract the following.
Order Date: 01/12/2017
Thanks,
Ana
|
|
|
|
|
How about: Order Date: \d\d\/\d\d\/\d\d
|
|
|
|
|
Perhaps with a couple of extra \d s to cope with the four-digit year?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oops again.
|
|
|
|
|
Hi Richard,
My string is like the following.
Order placed at the store. Order Date: 01/12/2017 10:54 AM This was completed.
I would like to pull "Order Date: 01/12/2017 10:54 AM"
Hope this helps.
Thanks,
Ana
|
|
|
|
|
If you take my original Order Date: \d\d\/\d\d\/\d\d , plus Richard Deeming's reply to me \d\d for the rest of the year, then you should be able to work out what else is needed. And you can test your expression online at RegExr: Learn, Build, & Test RegEx[^].
|
|
|
|
|
|
If you want to include the "Order Date: " in your extracted value:
Order Date:\s*[^\s]+
If you just want the "01/12/2017", and you're using C#, then:
(?<=Order Date:\s*)[^\s]+
(Other regular expression processors may also support "zero-width positive lookbehind" assertions. But Javascript, for example, doesn't.)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard,
Thanks for your response!
Since I need the order date, I tried using "Order Date:\s*[^\s]+" per your post above, and it is pulling text after the date, time and AM/PM. So, I would like to pull everything before the date, time and AM/PM.
Any suggestions would be appreciated.
Thank you!
Ana
|
|
|
|
|
So, my string is like the following.
Order placed at the store. Order Date: 01/12/2017 10:54 AM This was completed.
I would like to pull "Order Date: 01/12/2017 10:54 AM"
Hope this helps.
Thanks,
Ana
|
|
|
|
|
You specifically said you wanted to extract the text up to the first space, and there is a space between 2017 and 10:54 . And then another space between 10:54 and AM .
If the date and time is always in the same format - which doesn't match the example you gave in your original message - then try something like:
Order Date: \d\d\/\d\d\/\d\d\d\d \d\d:\d\d [AP]M Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard,
Sorry for the confusion. I tried the expression that you posted and it works perfectly!
Also, I would like to pull "Name is: Tia" from the following string:
My friend's Name is: Tia She lives in Argentina.
Thanks so much,
Ana
|
|
|
|
|
Only one name, with no spaces?
Name is: [^\s]+ Demo[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|