|I am trying to use regular expression to get all the characters from a line until a specific character occurs.|
For example, I have the following line:
I want to be able to just extract the word context-root1
(in other words, I want to be able to extract all the characters before the /). I am trying to do this in a batch file. The code I have so far which is relevnt for this is as follows:
where the first line is looking at the string:
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/contextroot1/*"/>
and getting the string:
I need to be able to make it just get the string contextroot1. So in other words get all the words before the first / occurs.
I know that this would be possible with regular expressions, but not sure how it can be done.
I know this should be easily done with regular expresions, but I do not have a lot of experience with them.