RegExp _ SOLVED

Post Reply
victor Lukenga
Member
Posts: 21
Joined: Thu Feb 18, 2016 1:35 pm

RegExp _ SOLVED

Post by victor Lukenga »

Hi !

I Experiment with RegExp i want to Extract a Hyphen without go in scripting

(0, 0, 314.81677, 114.81682) mm

I want to Extract two element

In the "search" field I typed ([0-9]+.[0-9]) and I get 314.8

but how to extract 114.8 ?

Can you help me ?
Last edited by victor Lukenga on Thu Mar 24, 2016 9:51 am, edited 1 time in total.
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: RegExp

Post by loicaigon »

Hi Victor,

An option is to use after/before modifiers to isolate the value:

Image

HTH

Loic
http://www.ozalto.com
victor Lukenga
Member
Posts: 21
Joined: Thu Feb 18, 2016 1:35 pm

Re: RegExp

Post by victor Lukenga »

Thank you Loic

I don't know why I didn't think about that ! I feel silly :)

Thank You so much
jan_suhr
Member
Posts: 57
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: RegExp _ SOLVED

Post by jan_suhr »

Infact the RegEx you wrote will find both the third and fourth segment of your string.

This RegEx will only find the last segment:

Code: Select all

(?!\s)([0-9]+\.[0-9]+)(?=\))
It will exclude the space before and the ) at the end in the result but look for them in the search.

I use a great tool to write the RegEx and it gives you instant feedback on what you do.

http://www.mactechnologies.com/index.ph ... ds#regexrx

Jan
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
victor Lukenga
Member
Posts: 21
Joined: Thu Feb 18, 2016 1:35 pm

Re: RegExp _ SOLVED

Post by victor Lukenga »

your software is pretty cool !

I like to use this site http://regexr.com/ it's very helpful to build and test your regex
Post Reply