Skale
asked on
How to apply regex in my case in C#
Hello,
I tried to modify one ascii file with my inputs but i have to modify some lines with specific structures like below;
Structure is like below:
subvar.str ( #SEARCH_TERM# ) = '#VALUE#' ! Some Text
- There is no rule for white spaces around search term there can be found or not.
This is the real example:
subvar.str ( $_partname ) = '"XX-2000-1050"' ! $_partname, Definition
I'd like to find "$_partname" and then change it's value "XX-2000-1050". If it's fully string i have to put queto sign on my string otherwise if it's double or integer i'll not put anything begin and end of my value.
I'll appreciate if you can help about this.
I tried to modify one ascii file with my inputs but i have to modify some lines with specific structures like below;
Structure is like below:
subvar.str ( #SEARCH_TERM# ) = '#VALUE#' ! Some Text
- There is no rule for white spaces around search term there can be found or not.
This is the real example:
subvar.str ( $_partname ) = '"XX-2000-1050"' ! $_partname, Definition
I'd like to find "$_partname" and then change it's value "XX-2000-1050". If it's fully string i have to put queto sign on my string otherwise if it's double or integer i'll not put anything begin and end of my value.
I'll appreciate if you can help about this.
ASKER
Hi Zvonko,
I'd like to let space as is, at meantime i'll be test your approach in an hour i think.
I'd like to let space as is, at meantime i'll be test your approach in an hour i think.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello Hakan, does the Expression work for you?
ASKER
Hi Zvonko,
Thanks for your answer it worked! Thank you again.
Thanks for your answer it worked! Thank you again.
Open in new window
Or do you want to let the spaces as-is?