Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARRAY and findrx?
#1
Hi Gintaras

Macro Macro
Code:
Copy      Help
ARRAY(int) a; int i; str s
win("" "" "YAHOOMESSENGER" 0 0 0 a)
for(i 0 a.len)
,s.getwintext(a[i])
,out s

;output
;Eddy Example (eddyexample)
;alejandro

Some of the windows showing the name and yahoo Id between parentheses and some of them only the yahoo Id without parentheses.

Im trying to extract only the id's.

In that case it would be

eddyexample
alejandro
-----
Im sorry english isnt my first language and i cant explain it correct.

best regards
#2
Code:
Copy      Help
if(s.end(")")) s.gett(s 1 "()")
#3
perfect! i was actualy sure we would use findrx here...

thx for beeing that patient with us slow learners Smile

best regards
#4
GInt,

Any chance for a .getrx?

-jim
#5
it is in findrx

str s
s.getrx(...)
|
v
findrx(... s) ;;here s also can be int (length) and ARRAY (all submatches as strings or offsets)

Member function str.getrx
Code:
Copy      Help
function# $s $rx [flags] [submatch] [from_] ;;flags: 1 insens., 2 whole word, 8 multiline, 16 no submatches, 32 ANSI, pcre flags.

;Gets substring that matches regular expression.

;REMARKS
;Same as <help>findrx</help>, but called differently.

;EXAMPLE
;str string substring
;string="one 22 three"
;if(substring.getrx(string "\d+" 2)<0) end "not found"
;out substring


ret findrx(s rx from_ flags this submatch)

err+ end _error
#6
I see what you mean. Wink


Forum Jump:


Users browsing this thread: 1 Guest(s)