problem of regular expression with brackets
Hello
I have a Zebra printer string that contains tokens that I want to search.
^ BY2, 3, 55 ^ FT50, 219 ^ BCN, Y, N... ^ FD >: [[number 1]] ^ FS
^ BY2, 3, 55 ^ FT525, 221 ^ BCN, Y, N... ^ FD >: [[serial number 2]] ^ FS
^ FT170, 192 ^ XG000. GRF, 1, 1 ^ FS
^ FT220, 430 ^ A0N, 27, 27 ^ FH\ ^ ea FD2. #00931 drum kit / ^ FS
↑ FT350, 460 ^ A0N, 27, 27 ^ FH\ ^ FD #00602 ^ FS
^ FO10, 32 ^ GB780, 480, 8 B, 1 ^ FS
^ FT720, 500 ^ A0N, 10, 10 ^ FH\ ^ FD [[Date Code]] ^ FS
I want to find any instance of double hooks regardless of the bracketed text. I find [[SerialNumber 1]] for example, but I also want to analyze the entire string and ensure that there no case [[text]] left in the string. I was not able to build a regular expression that will find them.
Hi elrathia,.
Please find below screenshot
Kind regards
SrikrishnaNF
Tags: NI Software
Similar Questions
-
Problem on regular expressions
Hi all
I'm working on a project that require me to separate the following examples:
+ 0, + 0.0000 E1, - 4.33 + E1, - 4.222 + E1, - 6.33 + E2, - 6.55 + E2
What I need is the final four results separately:
-4.33 + E1.
-4.222 + E1,
-6.33_E2,
-6.55 + E2.
I'm totally cool regular expression. Any help is appreciated!
Thank you
+ Kunsheng
Hi, Kunsheng
Good evening exercise to learn regular expressions...
For example, quick and dirty:
I have the strong feeling that something's wrong here (I guess in ([0-9] + [1-9] +)), but in any case the above code is just starting point for you.
Andrey.
-
Evaluation of the regular expression with logical operator
Hi all
I am little confused with expression with logical operator evaluation. I'm trying to understand the in expression.
-----
eXa.getTrue () & & eXa.getFalse () | eXa.getFalse () & & eXa.getTrue () | eXa.getFalse () is false and True Count: 1 False Count: 3
According to the agreement, it should be true with True Count: 1 False Count: 3
It must run the 1 getTrue() then 1stGetFalse() and getfalse() then 2nd jump 2nd getTrue() and must run 3rd fetFalse()
-----
eXa.getTrue () & & eXa.getTrue () | eXa.getFalse () & & eXa.getTrue () | eXa.getFalse () is true and true count: 2 False Count: 0
According to the agreement, it should be true with True Count: 3 False Count: 0
He must run getTrue() 2 1 1 getFalse() jump and run 3rd getTrue() and jump the last getFalse().
-----
eXa.getTrue () | eXa.getFalse () & & eXa.getFalse () | eXa.getTrue () & & eXa.getFalse () presents itself as true and true count: 1 False Count: 0
According to the agreement, it should be true with True Count: 2 False Count: 2
It must run 1 getTrue() and jump getFalse() 1st run 2nd getFalse() and then run getTrue() 2nd and 3rd then getFalse()
Please, help me understand above expressions.
Here is the definition of methods:
Private boolean getTrue() {}
trueCount ++;
Boolean retrunValue = 4 > 3;
Return retrunValue;
}
Private boolean getFalse() {}
falseCount ++;
Boolean retrunValue = 3 > 4;
Return retrunValue;
}
Thanks for your help>
added parentheses to make order of the most obvious BSP. adding a "?" to show calls not executed.
(eXa.getTrue() && eXa.getFalse()) || (eXa.getFalse() && eXa.getTrue()) || eXa.getFalse() comes as false and True Count: 1 False Count: 3 (T && F) = F (F && ?) = F (F) = F F || F || F = F (eXa.getTrue() && eXa.getTrue()) || (eXa.getFalse() && eXa.getTrue()) || eXa.getFalse() comes as true and True Count: 2 False Count: 0 (T && T) = T (? && ?) = ? (?) = ? T || ? || ? = T eXa.getTrue() || (eXa.getFalse() && eXa.getFalse()) || (eXa.getTrue() && eXa.getFalse()) comes as true and True Count: 1 False Count: 0 (T) = T (? && ?) = ? (? && ?) = ? T || ? || ? = T
-
Another question about regular expressions with String.matches
don't match String.matches () method expressions when a substring of the string matches, or must match the whole string? So if I have the string '123ABC', and I ask match "1 or more letters" will be it fail because there are other that the letters in the string, but then spend if I add "1 or more letters AND numbers 1 or more? Thus, in the second case each character in the string is recorded in the research, as opposed to the first. Is that correct, or are there ways to JUST matching a substring in the string instead of all this? I'll do some examples too... but that makes sense?It must match the entire string. Use Matcher.find () to match on just a sub-string)
-
The regular expression Dilimit
How can I delimit the regular expression with the number sign (#) and then use an apostrophe in the expression.
Can someone give some explamples.
As regular expressions are placed in quotation marks, and I have an apostrophe in a string also how would I be able to specify the regular expression with a sign by dilimiting #.
Thank you
Published by: LostWorld Sep 15, 2010 05:40Hello
Not sure I understand the question you are faced with, but I think using q citing might help:
SQL> with t as ( 2 select 'abcd ''1234''' str from dual) 3 -- end of sample data 4 select str, regexp_substr(str, q'#'1234'#') str from t; STR STR ----------- ----------- abcd '1234' '1234'
The symbol # now includes the string in the example above.
You can view the documentation for more information in the link below:
http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/sql_elements003.htm -
Chain problem: not being able to escape a bracket for a possible regular expression
So, I have barely any idea of how to use regular expressions except a little knowledge of it in PHP.
What I'm trying to do is to separate the first part of a string of qualifier, so I need a regular expression since ideally I wish I could. The problem I have is that my attempt of separation does not work. I tried to do what I think the model or class Matcher, I tried to use String.split, and I tried using the regular String.replace method. What I'm trying to do is illustrated (I hope) in the following NBS:
From my understanding, the parentheses are supposed to be a wild card of sorts, so they would need to be escaped in order to be taken as a literal, which means that line 7 is supposed to correspond to any of the characters inside the brackets where the opening is preceded by a space and then delete them. The problem I have is that escaping brackets generates an error and does not escape their product the original string. So I don't know how to tell Java I use actually literal parentheses.public class SSCCE { public static void main(final String args[]) { final String testString = "I want to keep this sentence. (I wish to "+ "discard this sentence and the space in between the sentences.)"; final String testExtract = testString.replace(" \(.+\)",""); System.out.println(testExtract); } }
I tried to configure my preferences of error to ignore everything, but it does not work.
I don't know if it's important, but I use Java 1.6 and Eclipse for PHP 1.3.2.20110218 - 0812.rp0428 wrote:
Shouldn't be using replaceAll if you use a regular expression?http://docs.Oracle.com/javase/6/docs/API/Java/lang/string.html
and, on the assumption that you actually use a replaceAll(), you need to escape to the '-' characters as they are themselves i.e. Java escape characters
" \\(.+\\)"
In addition, the use of ".". +"can lead lead to important feedback. In this simple example you probably won't notice it, but in general, you'd better avoid the return back by using the reluctant modifier or by replacing the '.' by a character set that does not include the character terminal.
-
Problem with regular Expression
Hello!!
I have a problem with the regular expression. I want to validate only one word, and second are the same. To do this, I wrote a regex
Model p=Pattern.compile("([a-z][a-zA-Z]*)\\s\1");
Matcher m = p.matcher ("nikhil nikhil");
Boolean t = m.matches ();
If (t)
System.out.println ("it's a game");
on the other
System.out.println ("is no match);
The result I get is always 'there no match. "
Your timely help will be very appreciated.
ConcerningHello.
You are missing a slash in the regex
Pattern p = Pattern.compile("([a-z][a-zA-Z]*)\\s\\1"); Matcher m = p.matcher("nikhil nikhil"); boolean t = m.matches(); if (t) { System.out.println("There is a match"); } else { System.out.println("There is no match"); }
-
problem with the validation type: regular expression
Hi all
I have a text field element call p40_opt
in the past, this element could accept only the values 1-9
I made a posting type: regular expression
1 validation expression:
p40_opt
2 validation expression:
[1-9]
works very well.
Today, I wanted to add an option that p40_opt can also contains the value: 10
so I changed the range [1-10].
and now, it's not good because if I choose another option plus 1 and 10 to Ant
he do the validation.
what I'm missing here?
Thanks in advance
Under the direction of: naama on August 6, 2009 01:31The forum software has mutilated regular expressions in your message. You should edit, wrapping up the regular expressions in.
tags so they are properly displayed.
^ [1-9] {1} $. ^ $ 10
would be one regular expression that performs the required validation, however a regular expression doesn't appear to be the most straightforward way to validate such a range of values. A SQL or PL/SQL validation would be clearer, using the expression:
: p40_opt between 1 and 10
-
Analyze the Mac address with the regular expression matching
Hello world
I have a problem with the function of regular expression matching,
I try to analyse the response both a query arp - a 192.168.0.15 to retrieve the MAC address of the remote IP address, I used the following regular expression: ^ ([0-9a-fA-F]{2}[:-]){5}([0-9a-fA-F]{2})$
I wonder why should I do a subset of the first string to extract only the part of the MAC address. The regular Expression function is not able to recognize the regular expression directly in the middle of a string?
I only works when I extracted the subset of tring right as in the picture below.
Thanks for your replies.
Get rid of the "^" at the beginning of your regular expression. You are ordering him to find the model at the beginning of the string.
-
Need help with a simple regular expression replacement
Hello everyone,
He comes to the table that I have to work with.
My select statement isCREATE TABLE "TBL_ACCOMMODATION" ("ACCOMMODATION_ID" NUMBER, "HOTEL_NAME" VARCHAR2(100), "ADDRESS" VARCHAR2(200), "LOCATION" VARCHAR2(100), "PHONE" VARCHAR2(50), "EMAIL_ADDRESS" VARCHAR2(60), "CONTACT_PERSON" VARCHAR2(60), "STATUS" CHAR(1), "CREATED_BY" VARCHAR2(10), "CREATED_DATE" DATE, "MODIFIED_BY" VARCHAR2(10), "MODIFIED_DATE" DATE, "MOBILE" VARCHAR2(50)) REM INSERTING into TBL_ACCOMMODATION Insert into TBL_ACCOMMODATION (ACCOMMODATION_ID,HOTEL_NAME,ADDRESS,LOCATION,PHONE,EMAIL_ADDRESS,CONTACT_PERSON,STATUS,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,MOBILE) values (147,'Testt','Auckalnd','Henderson','565756776','[email protected]','Jasmine','A',null,null,'JEEJJ',to_date('23/10/12','DD/MM/RR'),null); Insert into TBL_ACCOMMODATION (ACCOMMODATION_ID,HOTEL_NAME,ADDRESS,LOCATION,PHONE,EMAIL_ADDRESS,CONTACT_PERSON,STATUS,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,MOBILE) values (129,'Kirby Hotel','25A Aitken Street Wellington','Wellington','04 918 8513','[email protected]','Deahdoow Maharg','A',null,null,'LEAN',to_date('14/02/13','DD/MM/RR'),'027 356 4333'); Insert into TBL_ACCOMMODATION (ACCOMMODATION_ID,HOTEL_NAME,ADDRESS,LOCATION,PHONE,EMAIL_ADDRESS,CONTACT_PERSON,STATUS,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,MOBILE) values (167,'Avenue ee','10 Wellington Street Wellington','Wellington','4444444','[email protected]','James','A',null,null,'LEAN',to_date('21/02/13','DD/MM/RR'),null); Insert into TBL_ACCOMMODATION (ACCOMMODATION_ID,HOTEL_NAME,ADDRESS,LOCATION,PHONE,EMAIL_ADDRESS,CONTACT_PERSON,STATUS,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,MOBILE) values (185,'Quadrant Hotel','10 Waterloo Quadrant, Auckland','Auckland','9555555','[email protected]','Quentin QQ','A',null,null,'LEAN',to_date('04/03/13','DD/MM/RR'),null);
I have to use the function replace twice. One is to replace the Chr (13) a comma is second band a comma where there are two commas.SELECT acc.hotel_name || '(' || replace(replace(acc.address,chr(13),', '),',,',',') || ')' FROM TBL_ACCOMMODATION acc inner join ijs_seminar s ON acc.accommodation_id = s.accommodation_id where s.seminar_id = :P27_SEMINAR_ID
I don't know much about regular expressions.
If someone can show me a better way to handle this using the regular expression rather than a heavy means above.
Thanks in advance
AnnHi, Ann.
Ann586341 wrote:
Hello everyone,He comes to the table that I have to work with.
CREATE TABLE "TBL_ACCOMMODATION" ("ACCOMMODATION_ID" NUMBER, "HOTEL_NAME" VARCHAR2(100), "ADDRESS" VARCHAR2(200), "LOCATION" VARCHAR2(100), "PHONE" VARCHAR2(50), "EMAIL_ADDRESS" VARCHAR2(60), "CONTACT_PERSON" VARCHAR2(60), "STATUS" CHAR(1), "CREATED_BY" VARCHAR2(10), "CREATED_DATE" DATE, "MODIFIED_BY" VARCHAR2(10), "MODIFIED_DATE" DATE, "MOBILE" VARCHAR2(50)) REM INSERTING into TBL_ACCOMMODATION Insert into TBL_ACCOMMODATION (ACCOMMODATION_ID,HOTEL_NAME,ADDRESS,LOCATION,PHONE,EMAIL_ADDRESS,CONTACT_PERSON,STATUS,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE,MOBILE) values (147,'Testt','Auckalnd','Henderson','565756776','[email protected]','Jasmine','A',null,null,'JEEJJ',to_date('23/10/12','DD/MM/RR'),null); ...
Thanks for posting the sample data. You post the results, but the validation of the existing query which I suppose, produced good results. I can't run this query, because it requires the ijs_seminar table and a connection variable that also has no post, but I can just comment on the join and the WHERE clause.
Is this really the best set of sample data for this question? This problem involves Chr (13) and repeated commas, but I don't see any s CHR (13) or repeated commas in the sample data. In addition, it seems that there are a lot of columns that play no role in this issue and just to make things difficult to read.
My select statement is
SELECT acc.hotel_name || '(' || replace(replace(acc.address,chr(13),', '),',,',',') || ')' FROM TBL_ACCOMMODATION acc inner join ijs_seminar s ON acc.accommodation_id = s.accommodation_id where s.seminar_id = :P27_SEMINAR_ID
I have to use the function replace twice. We need to replace the Chr (13) by a comma,.
As posted, inside REPLACE replaces Chr (13) with a comma and a space which could be important if you then pick up consecutive commas.
second is the band a comma where there are two commas.
I don't know much about regular expressions.
If someone can show me a better way to handle this using the regular expression rather than a heavy means above.Assuming you want to replace Chr (13) with just a comma, then an equivalent would be:
SELECT acc.hotel_name || '(' || REGEXP_REPLACE ( acc.address , '[,' || CHR (13) || ']{1,2}' , ',' ) || ')' AS h FROM tbl_accommodation acc INNER JOIN ijs_seminar s ON acc.accommodation_id = s.accommodation_id WHERE s.seminar_id = :P27_SEMINAR_ID ;
In the argument to REGEXP_REPLACE 2nd
[xy]{1,2}
medium 1 to 2 characters of set of x and y. This could be
x or
there or it could be 2 characters
XY or the other way
YX or it could be the same characters 2
XX or
YYREGEXP_REPLACE is slower that REPLACE. Even if your original expression is longer, it may be more effective. (Performance may be not a problem in this case.)
-
the simple regular expression problem
Hello
I need assistance with regular expressions. I have a situation when I need to get data from one table to the other and I think that my problem can be solved using REG EXP, but I don't know how to use them properly.
I need to separate fileld varchar2 which is basically number/number in 2 separate number fields
I need to get the code in the co and po columns. I think the result should look something like this, but:CREATE TABLE tst (CODE VARCHAR2(10)); INSERT INTO tst VALUES('10/15'); INSERT INTO tst VALUES('13/12'); INSERT INTO tst VALUES('30'); INSERT INTO tst VALUES('15'); CREATE TABLE tst2 (po NUMBER, co NUMBER);
Any help appreciatedINSERT INTO tst2 SELECT regexp_substr(CODE 'something here to get the number before /') AS po, regexpr_substr(CODE 'something here to get number after') AS co FROM tst;
Agree with the above,
However, if you really want to know how to do with regular expressions you can do it like this...
SQL> select regexp_substr('10/15','[^/]+',1,1) from dual; RE -- 10 SQL> select regexp_substr('10/15','[^/]+',1,2) from dual; RE -- 15
-
Hi @ all,
I need a regular expression more difficult, I don't know Don t.
I have a big file with many pages .htm (800-1000) and I have to do the following:
http://www.domain.de/ AB % 32-xyz? myshop = 123
I have to delete the "ab % 32-xyz", the problem is, that it is, it could be each symbol, the letter or digit.
Then the area between " " http://www.domain.de/ ' 'and'? myshop = 123 "(these 2 areas are identical in all documents each time) should be removed.
Anyone could tell me how to do this with regular expressions in dreamweaver?
Thank you
Felix
P.S.: Sorry, my English is not so good, I m from the Germany
You want to replace the random text with anything?
If this is not the case, this is how you do in DW:
- Make a backup of the folder that you want to change, just in case something goes wrong
- Edition > search and replace
- In the find and Replace dialog box, select the folder in the menu drop-down "search in" and select the folder that you want to use.
- Select the Source Code from the drop-down search menu.
- Place the following code in the search text box:
(http://www \.domain\.de/) [^?] +(\? MYshop = 123) - Place the following code in the text box replace:
$1$ 2 - In Options, select the checkbox "use regular expression.
- Click on replace all. Dreamweaver warns you that the operation cannot be undone in pages that are not currently open. As long as you have made a backup, click OK to run the operation.
-
Need help with regular expressions
Hi all
I need your help, because I have no ideas more...
I have the following problem: in the column of the database table, I have the string with the names of files already uploaded to the database. For example: + File1_V01.txt +, + File1_v02.txt +, + File1_01_v01.txt +, etc. The string _vxx * + or _Vxx * + (non-case sensitive) represents the version of the file.
Now the problem: I'll upload the file with the name + File1_v02.txt + (already exists in the table).
If the file name already exists in the table the pl/sql function should get the name of the file with the following version number. In my case it takes + File1_v03.txt +.
Is it possible to do this using SELECT with regular expressions?
Best regards and thanks!with t as ( select 'File_V05.txt' fn from dual union all select 'File_V04.txt' fn from dual union all select 'File2_v03.doc' fn from dual union all select 'File2_v115.doc' fn from dual union all select 'File2_v15.doc' fn from dual union all select 'File1_v03.doc' fn from dual union all select 'File1_v115.doc' fn from dual union all select 'File1_v999.doc' fn from dual union all select 'File2.doc' fn from dual union all select 'File2_v05.doc' fn from dual union all select 'File1_v01.txt' fn from dual union all select 'File1_v02.txt' fn from dual union all select 'File1_v1.txt' fn from dual union all select 'File1_v1.doc' fn from dual union all select 'File1_v2.txt' fn from dual union all select 'File2_v01.doc' fn from dual union all select 'File2_v02.doc' fn from dual union all select 'File1_ABC_v01_DEF.docx' fn from dual union all select 'File1_ABC_V02_ABC.docx' fn from dual union all select 'File1_ABC_v01_12_04_17.docx' fn from dual union all select 'ABC_V1_QWERT.pdf' fn from dual ) select fn, case when fn!=fn_new then last_value(fn_new) over(partition by regexp_replace(upper(fn),'V[[:digit:]]+','') --(.*?V0*)([1-9]+)(\..*?)$ order by nv rows between unbounded preceding and unbounded following ) else fn end fn_new from ( select case when v-1 <= 0 then fn else regexp_replace (fn, '(_v|_V)(\d*)', case when length(substr(fn,v+1,p-v-1)+1) > (p-v-1) then '\1'||to_char(substr(fn,v+1,p-v-1)+1) else '\1'||lpad(substr(fn,v+1,p-v-1)+1,p- v-1,0) end ) end fn_new ,fn ,case when v-1 <= 0 then -1 else substr(fn,v+1,p- v-1)+1 end nv from ( select fn, regexp_instr(upper(fn),'_V[[:digit:]]+',1,1,1) p, instr(upper(fn),'_V')+1 v from t ) ) order by fn FN FN_NEW ABC_V1_QWERT.pdf ABC_V2_QWERT.pdf File_V04.txt File_V06.txt File_V05.txt File_V06.txt File1_ABC_v01_DEF.docx File1_ABC_v02_DEF.docx File1_ABC_v01_12_04_17.docx File1_ABC_v02_12_04_17.docx File1_ABC_V02_ABC.docx File1_ABC_V03_ABC.docx File1_v01.txt File1_v3.txt File1_v02.txt File1_v3.txt File1_v03.doc File1_v1000.doc File1_v1.doc File1_v1000.doc File1_v1.txt File1_v3.txt File1_v115.doc File1_v1000.doc File1_v2.txt File1_v3.txt File1_v999.doc File1_v1000.doc File2.doc File2.doc File2_v01.doc File2_v116.doc File2_v02.doc File2_v116.doc File2_v03.doc File2_v116.doc File2_v05.doc File2_v116.doc File2_v115.doc File2_v116.doc File2_v15.doc File2_v116.doc
-
Regular expression matching receives only two digit in brackets
Hello
I use the regular expression of the correspondence with the following expression. It is only able to get all the numbers that are not mere numbers. I want to retrieve all the values which lie between >< in="" the="" string="" and="" create="" an="">
Then
182 2 would be output
182
2
Any help would be appreciated. I've attached what I have so far. Right now I still have the >< and="" it="" can="" only="" grab="" numbers="" that="" are="" not="" single="">
Use (>.) [ ^(<>)]*)< *="" instead="" of=""> >
-
Problems with the help of control Edit Expression with tab control
Hi all
I am facing a strange problem when using Expression Edit Control with a tab control.
When I put the Expression of the RichEdit controls on several tabs in a tab control, and when I run the application, the Expression Edit controls in a single tab are visible, others get invisible! I do NOTHING with them, but they do not simply show upward!
I first faced this problem using Expr editing controls in Visual Studio c#. NET - with tab controls. For verification, I created a simple VI is LabVIEW to see if the problem is with my request / problem with Expression Edit controls in c#, etc. But voila! A similar behavior in LabVIEW too!
I'm doing something wrong? OR do not do something right? Ask someone for help please ASAP!
Thanks a ton in advance!
DASI
PS: Attached the VI here (LabVIEW 8.5) just download and run it, and you will see probably what I'm talking about!
Maybe you are looking for
-
Location of power Services to find my friends
Can not pass of location Services for him to find my friends. Also in the settings-life private location Services is enabled; 'Find friends' went to 'NEVER', but I am unable to change it. "Sharing my position", it is turned on. Can anyone help please
-
MacBook Pro retina 13 "task damage
https://www.Facebook.com/photo.php?fBid=10153777752291094 & set = o. 901846886516016 & type = 3 Historically, I bought my Macbook 13 "screen retina; and after that I have seen shocking images on the website staingate.org , at first I wouldn't not giv
-
Firefox keeps telling me to update, even though I know that I've updated.
On aid, when it checks updates told me that I am on the last, but everywhere elsewhere (for example Devientart or Mozilla Startpage) it tells me I need to update. I'm sure that I've updated, and I can't access certain pages without being on the lates
-
Qosmio F20-136: scanned TV guide channel - save the file so you can recharge?
I have a Qosmio F20 - 136 running XP Media Center. My question is does anyone know the name of the file that has the channels scanned so that if I do a re scan and don't get all channels from the list, because of my reception antenna I can re - load
-
When prompted to save I have wrong says no - how to cancel that and recover the doc
I did some work on book - 2 hours of writing - I had been clicking without butter for spelling so when it comes time to save the changes I clicked on none and lost what I wrote - I know its here somewhere, but the question is - can I get it back?