Xibalba Posted October 18, 2010 Share Posted October 18, 2010 (edited) Hey, I've just started experimenting with regexp..I don't even know how to begin coding an expression that finds x and y in examples as follows:Lorem ipsum dolor x#y sit ametVivamus x#y porta metus non purus congue mollis.Fusce feugiat nunc vel mi accumsan vel dictum dolor x#y tincidunt.Etiam nibh odio, tempor eu euismod x#y id, cursus id dolor.x and y are always integers (i.e 2, 10, 141)the lines can contain all kinds of characters (but only one '#')Perhaps someone can start me off, guiding me in the right direction?ThxEdit: Thanks, works splendid. Edited October 18, 2010 by Xibalba Link to comment Share on other sites More sharing options...
UEZ Posted October 18, 2010 Share Posted October 18, 2010 Try this: #include <Array.au3> $text = "Lorem ipsum dolor 1#3 sit amet" & @CRLF & _ "Vivamus 2#4 porta metus non purus congue mollis." & @CRLF & _ "Fusce feugiat nunc vel mi accumsan vel dictum dolor 11#23 tincidunt." & @CRLF & _ "Etiam nibh odio, tempor eu euismod 13#14 id, cursus id dolor." $aRegEx = StringRegExp($text, "(.\d#\d.)", 3) _ArrayDisplay($aRegEx) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
trancexx Posted October 18, 2010 Share Posted October 18, 2010 (edited) You need to spot pattern. Apparently it's: anything-space-number(any size)-#-number(any size)-space-anythingNow open AutoIt help file and you are done in 5 minutes.edit: or UEZ could try solving this. Edited October 18, 2010 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
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