gcue Posted June 23, 2016 Posted June 23, 2016 hello i am trying to pull the test from this line but i am just getting Last Keyword XMP $string = "Last Keyword XMP : test" ConsoleWrite(StringLeft(StringRegExpReplace($string, "Last Keyword XMP.*?(\d.+)", "$1"), 16) & @CRLF) thank you in advance!
iamtheky Posted June 23, 2016 Posted June 23, 2016 $string = "Last Keyword XMP : test" ConsoleWrite(StringRegExp($string , "\s+:\s+(.*\z)" , 3)[0] & @CRLF) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
iamtheky Posted June 23, 2016 Posted June 23, 2016 very welcome, as well without regexp (provided the colon is always there) consolewrite(stringstripws(stringmid($string , stringinstr($string , ":" , 0 , -1) + 1) , 1) & @CRLF) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
mikell Posted June 23, 2016 Posted June 23, 2016 $string = "Last Keyword XMP : test" Msgbox(0, "", StringRegExp($string , '\w+$' , 1)[0])
gcue Posted June 23, 2016 Author Posted June 23, 2016 i tried to use it (tried switching with a V to accept anythign that isnt a vertical whitespace character) with this but it didnt work even if i took out the comma $string = "GPS Position : 75 deg 7 41.99 N, 118 deg 3 37.21 W" ConsoleWrite(StringRegExp($string, '\V+$', 1)[0] & @CRLF)
mikell Posted June 23, 2016 Posted June 23, 2016 Do you agree when I say that "75 deg 7 41.99 N, 118 deg 3 37.21 W" is a little different string than "test" ? $string = "GPS Position : 75 deg 7 41.99 N, 118 deg 3 37.21 W" ConsoleWrite(StringRegExp($string, ':\h*([^:]+)$', 1)[0] & @CRLF)
gcue Posted June 23, 2016 Author Posted June 23, 2016 haha yes.. thats why i thought V would work since it means anythign non white vertical character lol
jguinch Posted June 23, 2016 Posted June 23, 2016 $string = "GPS Position : 75 deg 7 41.99 N, 118 deg 3 37.21 W" ConsoleWrite(StringRegExpReplace($string, '^[^\d]+', '') & @CRLF) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now