Jump to content
Sign in to follow this  
n9mfk9

StringRegExpReplace(

Recommended Posts

n9mfk9

hi everyone

Im try to look for .. or ....

this is not working

$test = StringRegExpReplace($line,('.{2,4}','//')

what did i do wrong Thanks Beau

Share this post


Link to post
Share on other sites
weaponx

You need to post an example string that you are trying the replace on. You should also tell us what you expect the output to look like.

Share this post


Link to post
Share on other sites
n9mfk9

You need to post an example string that you are trying the replace on. You should also tell us what you expect the output to look like.

here the input

$sunrise = "%sunrise%"; ..................sun rise time (make sure you have the correct lat/lon

here what i went $sunrise = "%sunrise%"; //sun rise time (make sure you have the correct lat/lon

the number of dots change on each line that why i was trying to seat a range

thanks beau

Edited by n9mfk9

Share this post


Link to post
Share on other sites
Bowmore

here the input

$sunrise = "%sunrise%"; ..................sun rise time (make sure you have the correct lat/lon

here what i went $sunrise = "%sunrise%"; //sun rise time (make sure you have the correct lat/lon

the number of dots change on each line that why i was trying to seat a range

thanks beau

Try this

$test = StringRegExpReplace($line,('\.{2,4}','//')

In regular expressions the dot character '.' actually means any character if you want to find actual dots you need to escape it by placing a backslash before it e.g. '\.'


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
n9mfk9

I got this error

C:\Documents and Settings\beau thompson\My Documents\au3\test\weatherpage\mytagmaker.au3(35,48) : ERROR: unbalanced paranthesis expression.

$test = StringRegExpReplace($line,('\.{2,4}',

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\beau thompson\My Documents\au3\test\weatherpage\mytagmaker.au3 - 1 error(s), 0 warning(s)

thanks Beau

Share this post


Link to post
Share on other sites
weaponx

So...did you take out the extra parentheses?

Share this post


Link to post
Share on other sites
n9mfk9

Hi everyone i got it working with

$output = StringRegExpReplace($line,"\.{2,9}","")

thanks Beau

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×