Hey Guys, So I have a JTextfield in the cells of 1 of the columns in my JTable I want to allow only numbers and up to one dot/period. Doesant need to contain a period. The persiod can be anywhere except at the end of the number. 1 ok .1 ok 1.1 ok 1.1.1 not ok 1. not ok This is my expression in my code Currantly it allows only numbers which is good, but it doesant allow any periods, :(... private JTextField createTextField() { JTextField field = new JTextField(); ((AbstractDocument) field.getDocument()).setDocumentFilter(new DocumentFilter() { @Override public void insertString(FilterBypass fb, int …

Member Avatar
Member Avatar
+0 forum 23

I am not a computer professional, only like to develop my own toys. I am using Globi Flow to get the info I need from the XML file. All is done, except for one instance where I do not have the closing tag Regular node with closing tag: <proper price>$4</price> Below is the code used for all data extraction. preg_match_all_gf("/<city>(.*?)<\/city>/ism", [(variable)token],4) This would get the 4th occurrence. And this is what I currently need and it does not have the closing tag: <comp score:"9.0"> I managed to get the first digit (in the example above, 9) using Regex, as it …

Member Avatar
Member Avatar
+0 forum 7

For anyone who is having trouble with regular expressions, I suggest you have a look at [this site](https://regexper.com/#%5Cd%7B1%2C3%7D) by Jeff Avallone. It takes a regular expression in the native (cryptic) format and produces a visual display of the same expression. For example, ^[a-z0-9_-]{3,16}$ becomes ![Screenshot_(10).png](/attachments/large/3/8a654e76556ecc115d044b9d7626b810.png "align-center") and the pattern for an email address    ^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$ becomes ![Screenshot_(11).png](/attachments/large/3/a18ac7c9e13bb301473bfbf69c7bbd46.png "align-center") One caveat - you will see \d{3,5} expanded as ![Screenshot_(12).png](/attachments/small/3/5d48e25ed2af2f0033d919087ecf2e8c.png "align-center") which may seem incorrect at first glance, however, the `2...4 times` refers not to the number of digits but the number of extra "trips" back through the loop so if you …

Member Avatar
+8 forum 0

Hello guys i need to get all currencies in the world is there anyone who knows where to get them in a file so i can import it in my website or someone who can help me to solve with regular expression here is the [WEBSITE](http://www.xe.com/currencytables/?from=INR) where i have fund them but i do not know how to sepperate just the currencies if someone could do that for me will be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 1

Here is a weird regular expression for emails . We can have various kind of email addresses [email]string1@somemail.com[/email] [email]string1@somemail.co.in[/email] [email]string1.string2@somemail.com[/email] [email]string1.string2@somemail.co.in[/email] The following regular expression can find any of the mails above email2="santa.banta@gmail.co.in" email1="arindam31@yahoo.co.in'" email="bogusemail123@sillymail.com" email3="santa.banta.manta@gmail.co.in" email4="santa.banta.manta@gmail.co.in.xv.fg.gh" email5="abc.dcf@ghj.org" email6="santa.banta.manta@gmail.co.in.org" [CODE]re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email) >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email2) >>> x.group() 'santa.banta@gmail.co.in' >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email1) >>> x.group() 'arindam31@yahoo.co.in' >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email) >>> x.group() 'bogusemail123@sillymail.com'[/CODE] This seems too complicated right... I generalized it a bit.... [CODE]>>> x=re.search('(\w+[.|\w])*@(\w+[.])*\w+',email4) >>> x.group() 'santa.banta.manta@gmail.co.in.xv.fg.gh' [/CODE] The above regular expression now can detect any type of combination... Now if you want only email address ending with '.in' or '.com' then you can add a variation... …

Member Avatar
Member Avatar
+3 forum 10

Hi, i have a string that i want to match to a regular expression. The string is methodName(paraT1 para1, paraT2.name2 para2, paraT3.name3 para3) Inside the () there can be multiple of "aaa.bbb ccc" and "ddd eee" patterns The regular expression i wrote was : (\w*)(\s*)\((((\w*\.\w*)\s*(\w*))|((\w*)\s*(\w*)))(\s*\,\s*(((\w*\.\w*)\s*(\w*))|((\w*)\s*(\w*))))*\) and the I get the first and the last (parameterType para) pattern but not the ones inbetween. How do i get the middle expression. appreciate a reply thanks in advance

Member Avatar
Member Avatar
+0 forum 6

Can someone kindly help me with a solution to this assignment http://math.hws.edu/eck/cs225/s09/lab9/ CPSC 225, Spring 2009 Lab 9: Sets in the Java Collection Framework For this week's lab, you will use two of the classes in the Java Collection Framework: HashSet and TreeSet. You will use these classes to implement a spell checker. This lab is due at the time of the next lab, next Tuesday, March 31. Please copy your work into the homework directory by that time. Your work from labs 6, 7, and 8 is due this week. I will not look for this work until this …

Member Avatar
Member Avatar
+0 forum 5

Hi, I hope this is the right place to post this. I am researching the possibility of registering a new domain name. I haven't decided what the correct name is yet but I want to figure out what names are available and would like to figure out a way to search for, for instance, all 5 character length .com domains that are still available and get them in a structured list (so I can sort them with an algorithm if the number turns out to be very high). This of course would need to be done through a service that …

Member Avatar
Member Avatar
+0 forum 4

Sometimes you want to add a little functionality to an existing class but you don't want to go to the trouble of sub-classing. A technique that you can use is known as **Extending**. For example, I frequently use regular expressions when working with strings. Wouldn't it be nice if strings supported regular expressions directly, but because they don't I have three choices: 1. sub-class the string class and add the functionality 1. write a separate function that takes a string and a regular expression as parameters 1. Extend the string class Extending can only be done within a module so …

Member Avatar
Member Avatar
+1 forum 1

1. Exactly what are regex? 2. Do we write them ourselves or are they prdefined expressions? 3. If we can write regex ourselves, how do we write them? 4. How do they check for invadalities? For example the email regex: [-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]{2,4} how does this expression check for valid email addresses? I have tried to look for simple explanations on the web but have found nothing confusing stuff. Thankyou!

Member Avatar
Member Avatar
+0 forum 1

I'm trying to extract an array of "<div>" and I am confounded by why this these two patterns work... preg_match_all('/<div class="date">.*?/m',$htm,$a); preg_match_all('/<div.*?</div>/m',$htm,$a); But this one does not return anything... preg_match_all('/<div class="date">.*?<\/div>/m',$htm,$a); Is there some regular expresion magic I am missing?

Member Avatar
Member Avatar
+0 forum 2

Hi i tried this regular expression `^(?:\00|9)[. ()-]*(?:\d[. ()-]*){8,14}$ `to enter a phone number in a text field ,but it didnt work like i wanted . what i want the rule to be is if the phone number starts with 9 then the length would be 8 digits, but if the phone number starts with 00 it would 14 in length on the same regular expression , the expression i found takes all the cases, like if it starts with 9 it could be 14 in length and vice versa ! the problem is that the phone number takes two …

Member Avatar
Member Avatar
+0 forum 6

I have been stuck on this python challenge http://www.pythonchallenge.com/pc/def/ocr.html . I am familiar with python re module and regex but I don't seem to get what the challenge wants me to do. If there's anyone else that has been there, I'll need some help

Member Avatar
Member Avatar
+0 forum 4

Dear team, I am facing difficulties to validate the below format. I want regular expression needs to be satisfied with the below condtion. $pattern = '/^\w[\w\s\.\%\-\(\)\[\]]*$/u'; $file_name = "(00)filename.jpg"; if(preg_match($pattern,$file_name)){ echo "Pattern matched"; }else { echo "Pattern not matched"; } I have tried several ways. But, the main problem is do not write the own pregmatch, instead need to modify the existing one which accepts the brackets(). Thanks, Prem

Member Avatar
Member Avatar
+0 forum 2

Hi i want pattern for checking no white space.

Member Avatar
Member Avatar
+0 forum 7

Hi there, I am working on a project and want to resolve invalid form submition. i want to create a regular expression which can check each form value that must not have any string like as: '"abc.Xyz What exactly the regular expression should be?, for more information please feel free to ask me.

Member Avatar
Member Avatar
+0 forum 2

Hope somebody can help me regarding regular expression. I have a shortcode format "<!--myproductsku-->" in the string, I want to use regular expression to extract myproductsku. And if there is a match replace "<!--myproductsku-->" with "This is my myproductsku.". Rey

Member Avatar
Member Avatar
+0 forum 3

I have solved it... Shame... -------------------------------- I have problem with this code: cin >> str; smatch m; regex e("([[:w:]]+)@([[:w:]]+)\.com"); //<- Here was the error (it was regex e("([[:w:]+)@([[:w:]]+)\.com");) silly me :(( bool found = regex_search(str, m, e); cout << "m.size() " << m.size() << endl; for (int n = 0; n < m.size(); n++) cout << "m[" << n << "]: str()=" << m[n].str() << endl; cout << "m.prefix().str(): " << m.prefix().str() << endl; cout << "m.suffix().str(): " << m.suffix().str() << endl; When you input something like: <whatever>test@gmail.com<yeah> output should be: m.size() 3 m[0] = test@gmail.com m[1] = test m[2] …

Member Avatar
+0 forum 0

Can any one help me to convert wildcard pattern into regular expression pattern using c#.Net...?

Member Avatar
Member Avatar
+0 forum 5

Hi all I have a textarea I would like to validate the same for empty spaces and on no input. Please find my jsfiddle [here](http://jsfiddle.net/Varun_Krishna/jJh8q/). How do I validate for empty spaces in the text area? what am I missing in my fiddle? Thanks Varun Krishna. P

Member Avatar
Member Avatar
+0 forum 6

Hi Friends. I am trying to conver the following grep syntax to replace using awk pattern match. Can you please help? tail -F $logFiles | grep " ERROR " | grep -v 'ERROR_SERVER \|Session is null for endpointId\|SYNCED_IN_VIEW_UPDATED'| cut -d" " -f10-14 | awk 'BEGIN..............}' I am seeing some buffering problems with tail -F piped to grep. So, would like to avoid grep.. Can someone help me how i can use pattern match instead of "grep " ERROR " | grep -v 'ERROR_SERVER \|Session is null for endpointId\|SYNCED_IN_VIEW_UPDATED'| cut -d" " -f10-14"? Thanks Srini

Member Avatar
+0 forum 0

i need a regex for ectract meta title, description exg: <meta name="description" content="xxxxx"> and <meta name="Description" content="xxxxx"> and <meta name="Descriptions" content="xxxxx"> and <Meta name="Descriptions" content="xxxxx"> and <META NAME="Description" content="xxxxx"> i want to extract all type od descrptions, same also meta title

Member Avatar
Member Avatar
+0 forum 4

Hello Everyone, As the title implies I need help extracting a name out of a string, my knolwedge of regular expressions is pretty limited. The strings I will be working with will look like this: 12345 Aragon Denvil L. 123-1234 A123456 AragonD AragonAD@fake.mail.us 1000001234 ABC-ABC 123ABCD123 ABCD 1234 A1234 ABC12345A1 AB123AB 17-Feb-12 54321 Mgmt Chan Jackie 123-4321 ABC4321 ChanJ ChanJ@fake.mail.us 0 ABC-ABC 123ABCD123 ABCD 1234 A1234 ABC12345A1 AB123AB 17-Feb-12 From the first line I would be trying to extract "Aragon Denvil L." and from the second "Mgmt Chan Jackie". Worst case scenario I could maybe get away with just extracting …

Member Avatar
Member Avatar
+0 forum 2

Hello guys, I am having a problem with a regular expression in my jquery validation. Can someone help me please. The method : $.validator.addMethod( function (value, element) { /^[A-Z]{1}\d{12}[A-Z0-9]{1}$/.test( value ); }, "Invalid NIC." ); An example of the NIC field : L261089652789A or L2610896527897

Member Avatar
Member Avatar
+0 forum 2

I've been having tonnes of issues with Mod Security. I am busy writing a CMS for a project at work and while developing a page to edit a certain database record I kept getting 403 errors. After hours of banging my head against my desk, adjusting bits of code I finally just changed the script to which my form was being posted, to contain a simple `echo "test";`. Even submitting to this simple page was kicking up a 403 error. I messed about with my form and I eventually found that if I reduced the amount of data I was …

Member Avatar
Member Avatar
+1 forum 7

Create a username that's at least 6 characters.It may include uppercase and lowercase letters. Usernames are case-sensitive. It also must include either:at least one number; or one of these symbols:_@/-

Member Avatar
Member Avatar
-1 forum 2

regular expression that accept only letters OR numbers.

Member Avatar
Member Avatar
+0 forum 1

Hi guys, I am struggling with regular expression.Can you please suggest the regular expression for the below patterns. I have tried many times with several patterns but still i could not resolve the below patterns. 1. Must contain at least one alpha character (i.e. a, b, c etc,) 2. Only accept the characters: numerals, spaces, + Also,provide some valuable reference urls. Thank you, Prem

Member Avatar
Member Avatar
+0 forum 5

Hi there everyone, I am having some difficulties getting a regular expression to work. I have a line of text with 5 numbers.I want to ignore the first number, and grab the other 4 numbers. Here is what the text I am dealing with looks like. 1681 12.33754513 7.066246057 6.079261254 2.953020134 1171 9.676875527 12.76832461 2.725877787 9.275756545 Here is the regular expression I came up with(I'm a noob at regexs). Pattern p = Pattern.compile("\\D+(\\d+)(\\d+)(\\d+)(\\d+)"); Matcher m = p.matcher(lineString2); if(m.find()){ double nr1 = Double.parseDouble(m.group(1)); double nr2 = Double.parseDouble(m.group(2)); double nr3 = Double.parseDouble(m.group(3)); double nr4 = Double.parseDouble(m.group(4)); Can anyone help me out with …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, I am using this method to read in a collection of ints and strings then converting the strings to numbers using the switch statement(as stated by my lecturer) and save it back into an array for further processing. However, everytime it gets to the line studentResponses[row][column] = scanner2.nextInt(); I get the error: **java.util.InputMismatch exception: null (in java.util.Scanner)**. I have spent so long trying to figure out what could be causing this error to no avail so any guidance at all would be appreciated :) public void readMarksData(String fileName, int numberOfStudents, int responsesPerStudent) throws FileNotFoundException { studentResponses = new …

Member Avatar
Member Avatar
+0 forum 2

The End.